no-unused-vars and egegeg for these files
This commit is contained in:
@@ -46,7 +46,7 @@ export const requester = (route, method, token, data, signal=null) => {
|
||||
options.headers.Authorization = 'Token ' + token;
|
||||
}
|
||||
|
||||
if (method == 'GET') {
|
||||
if (method === 'GET') {
|
||||
// pass
|
||||
} else if (['POST', 'PUT', 'PATCH'].includes(method)) {
|
||||
const formData = new FormData();
|
||||
@@ -59,7 +59,7 @@ export const requester = (route, method, token, data, signal=null) => {
|
||||
method: method,
|
||||
body: formData,
|
||||
};
|
||||
} else if (method == 'DELETE') {
|
||||
} else if (method === 'DELETE') {
|
||||
options = {
|
||||
...options,
|
||||
method: method,
|
||||
@@ -99,12 +99,12 @@ export const requester = (route, method, token, data, signal=null) => {
|
||||
})
|
||||
.catch(error => {
|
||||
const code = error.data ? error.data.status : null;
|
||||
if (code == 413) {
|
||||
if (code === 413) {
|
||||
throw customError({non_field_errors: ['File too big']});
|
||||
} else if (code >= 400 && code < 500) {
|
||||
return error.data.json()
|
||||
.then(result => {
|
||||
if (result.detail == 'Invalid token.') {
|
||||
if (result.detail === 'Invalid token.') {
|
||||
localStorage.clear();
|
||||
window.location = '/';
|
||||
}
|
||||
@@ -143,6 +143,6 @@ function useWindowSize() {
|
||||
}
|
||||
|
||||
export const useIsMobile = () => {
|
||||
const {width, height} = useWindowSize();
|
||||
const {width} = useWindowSize();
|
||||
return width <= 767;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user