add logout
This commit is contained in:
@@ -4,3 +4,7 @@ export async function loginUser(data: any) {
|
||||
return await callAPI.post("/auth/login", data).then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function logoutUser() {
|
||||
return await callAPI.post("/auth/logout").then((res) => res.data);
|
||||
}
|
||||
|
||||
|
||||
4
services/hooks/auth.hook.ts
Normal file
4
services/hooks/auth.hook.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { logoutUser } from "../api/auth.api";
|
||||
|
||||
export const useLogout = () => useMutation({ mutationFn: logoutUser });
|
||||
Reference in New Issue
Block a user