Suppress log, move constant to shared
parent
63ea4d1b8b
commit
05da325d7c
|
@ -472,3 +472,5 @@ export const PRESENTATION_MODE_ANIMATION_DELAY = 0 // In milliseconds.
|
|||
export const PRESENTATION_MODE_NOTIFICATION_DELAY = 2000 // In milliseconds.
|
||||
|
||||
export const ADMIN_NOTIFICATION_DELAY = 1500 // milliseconds
|
||||
|
||||
export const RES_UNAUTHORIZED = 401
|
||||
|
|
|
@ -2,7 +2,7 @@ import axios from 'axios';
|
|||
|
||||
let links
|
||||
|
||||
const UNAUTHORIZED = 401
|
||||
import {RES_UNAUTHORIZED} from 'shared/constants'
|
||||
|
||||
export default async function AJAX({
|
||||
url,
|
||||
|
@ -47,10 +47,10 @@ export default async function AJAX({
|
|||
}
|
||||
} catch (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
|
||||
const {auth} = links
|
||||
throw {auth, ...response} // eslint-disable-line no-throw-literal
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue