Skip to content

Commit

Permalink
fix :ErrorType code -> status 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
keemsebin committed Sep 12, 2024
1 parent 6e24de5 commit d88e0e8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {
import { Score, ScoreDetail } from '@/types/score';

export type ErrorType = {
code: number;
status: number;
message: string;
};

Expand Down Expand Up @@ -519,8 +519,6 @@ export async function getApplier(

//error handling
function expirationToken(error: AxiosError<ErrorType>) {
// const cookies = new Cookies(); //?
// cookies.getAll(); //?
removeToken();
window.location.href = '/login';
toast.error(error.response?.data?.message ?? `로그인 시간이 만료되었어요.`);
Expand All @@ -532,7 +530,7 @@ function fulfilledResponse(res: AxiosResponse) {
}
function rejectedResponse(error: AxiosError<ErrorType>) {
if (
error.response?.data?.code === 401 &&
error.response?.data?.status === 401 &&
error.response?.data?.message == '유효하지 않은 토큰입니다.'
) {
return expirationToken(error);
Expand Down

0 comments on commit d88e0e8

Please sign in to comment.