add lint js

This commit is contained in:
Romulus21
2024-03-06 09:42:12 +01:00
parent 2de7c78344
commit 115d597a09
26 changed files with 479 additions and 163 deletions

View File

@@ -6,8 +6,8 @@ import React, {
useContext,
useEffect,
useState
} from "react";
import axios from "axios";
} from "react"
import axios from "axios"
const AuthUserContext = createContext<AuthUserProps|undefined>(undefined)
@@ -28,7 +28,7 @@ export const AuthUserProvider = ({children}: PropsWithChildren) => {
const res = await axios.get('/api/user')
setAuthUser(res.data)
} catch (e) {
// @ts-ignore
// @ts-expect-error check axios response status
if (e.response.status === 401) {
console.info('no user login')
if (window.location.pathname !== '/connexion') {
@@ -44,7 +44,7 @@ export const AuthUserProvider = ({children}: PropsWithChildren) => {
const logout = async () => {
try {
setLoadingAuthUser(false)
const res = await axios.delete('/api/logout')
await axios.delete('/api/logout')
setAuthUser(null)
window.location.replace('/')
} catch (e) {