add logout

This commit is contained in:
2026-05-28 10:20:11 +03:30
parent fcc6a3733d
commit d0772c4c68
5 changed files with 74 additions and 41 deletions

View File

@@ -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);
}

View File

@@ -0,0 +1,4 @@
import { useMutation } from "@tanstack/react-query";
import { logoutUser } from "../api/auth.api";
export const useLogout = () => useMutation({ mutationFn: logoutUser });