no-unused-vars and egegeg for these files

This commit is contained in:
Kent Brockman
2022-07-12 21:14:23 -06:00
parent b61a34eef8
commit 0476df3388
9 changed files with 27 additions and 38 deletions
+5 -5
View File
@@ -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;
}