Suppress log, move constant to shared
parent
a5a90b862e
commit
e6561f0b52
|
@ -472,3 +472,5 @@ export const PRESENTATION_MODE_ANIMATION_DELAY = 0 // In milliseconds.
|
||||||
export const PRESENTATION_MODE_NOTIFICATION_DELAY = 2000 // In milliseconds.
|
export const PRESENTATION_MODE_NOTIFICATION_DELAY = 2000 // In milliseconds.
|
||||||
|
|
||||||
export const ADMIN_NOTIFICATION_DELAY = 1500 // milliseconds
|
export const ADMIN_NOTIFICATION_DELAY = 1500 // milliseconds
|
||||||
|
|
||||||
|
export const RES_UNAUTHORIZED = 401
|
||||||
|
|
|
@ -2,7 +2,7 @@ import axios from 'axios';
|
||||||
|
|
||||||
let links
|
let links
|
||||||
|
|
||||||
const UNAUTHORIZED = 401
|
import {RES_UNAUTHORIZED} from 'shared/constants'
|
||||||
|
|
||||||
export default async function AJAX({
|
export default async function AJAX({
|
||||||
url,
|
url,
|
||||||
|
@ -47,10 +47,10 @@ export default async function AJAX({
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const {response} = error
|
const {response} = error
|
||||||
if (!response.status === UNAUTHORIZED) {
|
if (!response.status === RES_UNAUTHORIZED) {
|
||||||
console.error(error) // eslint-disable-line no-console
|
console.error(error) // eslint-disable-line no-console
|
||||||
}
|
}
|
||||||
console.error(error) // eslint-disable-line no-console
|
// console.error(error) // eslint-disable-line no-console
|
||||||
const {auth} = links
|
const {auth} = links
|
||||||
throw {auth, ...response} // eslint-disable-line no-throw-literal
|
throw {auth, ...response} // eslint-disable-line no-throw-literal
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue