260702_01_ENH: 리스트 작업 도중 공용 ui를 적용하기 위한 중간 커밋
This commit is contained in:
@@ -15,7 +15,15 @@ export const useLoginMutation = () => {
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async (v: { userId: string; userPw: string; seatNum: string; loginType: string }) => {
|
||||
return nextApi.post<LoginUser>("/login", { userId: v.userId, userPw: v.userPw }, { autoLogoutOnAuthError: false });
|
||||
return nextApi.post<LoginUser>(
|
||||
"/login",
|
||||
{ userId: v.userId, userPw: v.userPw },
|
||||
{
|
||||
skipUnauthorizedHandler: true,
|
||||
skipForbiddenHandler: true,
|
||||
skipResponseErrorHandler: true,
|
||||
},
|
||||
);
|
||||
},
|
||||
onSuccess: (data, v) => {
|
||||
try {
|
||||
@@ -38,7 +46,11 @@ export const useLogoutMutation = () => {
|
||||
const userId = auth.user?.userId ?? "";
|
||||
try {
|
||||
if (userId){
|
||||
await nextApi.post(`/logout/${userId}`, null, { autoLogoutOnAuthError: false });
|
||||
await nextApi.post(`/logout/${userId}`, null, {
|
||||
skipUnauthorizedHandler: true,
|
||||
skipForbiddenHandler: true,
|
||||
skipResponseErrorHandler: true,
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
@@ -51,4 +63,4 @@ export const useLogoutMutation = () => {
|
||||
qc.clear(); // 다음 사용자/세션에 서버상태 남지 않게
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user