File tree Expand file tree Collapse file tree 1 file changed +1
-26
lines changed Expand file tree Collapse file tree 1 file changed +1
-26
lines changed Original file line number Diff line number Diff line change @@ -80,29 +80,4 @@ const updateUser = async (data: UserData): Promise<void> => {
8080 }
8181} ;
8282
83- const getUserLoggedIn = async (
84- setIsLoading : SetStateCallback < boolean > ,
85- setIsAdmin : SetStateCallback < boolean > ,
86- setIsError : SetStateCallback < boolean > ,
87- setAuth : SetStateCallback < boolean > ,
88- ) : Promise < void > => {
89- try {
90- const response : AxiosResponse < UserData > = await axios (
91- `${ API_BASE } /api/auth/me` ,
92- getAxiosConfig ( ) ,
93- ) ;
94- const data = response . data ;
95- setIsLoading ( false ) ;
96- setIsAdmin ( data . admin || false ) ;
97- } catch ( error ) {
98- setIsLoading ( false ) ;
99- const axiosError = error as AxiosError ;
100- if ( axiosError . response ?. status === 401 ) {
101- setAuth ( false ) ;
102- } else {
103- setIsError ( true ) ;
104- }
105- }
106- } ;
107-
108- export { getUser , getUsers , updateUser , getUserLoggedIn } ;
83+ export { getUser , getUsers , updateUser } ;
You can’t perform that action at this time.
0 commit comments