Skip to content

Commit 4c2ddc2

Browse files
committed
chore: remove unused getUserLoggedIn
1 parent cb98da3 commit 4c2ddc2

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

src/ui/services/user.ts

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff 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 };

0 commit comments

Comments
 (0)