From afcf79c40b3378a22ab0939c65f7ca8eed13ff85 Mon Sep 17 00:00:00 2001 From: prgmr99 Date: Tue, 7 May 2024 19:27:43 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20#140=20=EC=8B=A0=EC=B2=AD=EC=9E=90?= =?UTF-8?q?=20=EA=B4=80=EB=A6=AC=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=A0=91?= =?UTF-8?q?=EA=B7=BC=20=EA=B6=8C=ED=95=9C=20=EC=97=86=EC=9D=84=20=EB=95=8C?= =?UTF-8?q?,=20=EB=A6=AC=EB=8B=A4=EC=9D=B4=EB=A0=89=EC=85=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/axiosInstance.ts | 4 ++++ src/service/recruit/applicant.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/src/service/axiosInstance.ts b/src/service/axiosInstance.ts index ba69e542..c312e59e 100644 --- a/src/service/axiosInstance.ts +++ b/src/service/axiosInstance.ts @@ -1,6 +1,7 @@ import axios, { AxiosError, AxiosResponse, InternalAxiosRequestConfig } from 'axios'; import { CustomInstance } from '../types'; import qs from 'qs'; +import { useNavigate } from 'react-router-dom'; const axiosConfig = { baseURL: import.meta.env.VITE_BASE_URL, @@ -31,6 +32,9 @@ const onError = (error: AxiosError) => { if (response?.data) { console.error(response.data); + if (response?.status === 400) { + window.location.href = '/signin'; + } } return Promise.reject(error); diff --git a/src/service/recruit/applicant.ts b/src/service/recruit/applicant.ts index 40ab2b43..c644e96a 100644 --- a/src/service/recruit/applicant.ts +++ b/src/service/recruit/applicant.ts @@ -1,3 +1,4 @@ +import { useNavigate } from 'react-router-dom'; import { ApplicantList, ApplicantPageInfo, From f2c039a60da1614b9ef8afbc6818db91d6025332 Mon Sep 17 00:00:00 2001 From: prgmr99 Date: Tue, 7 May 2024 19:30:46 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20403=20=EC=97=90=EB=9F=AC=EB=8F=84?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/axiosInstance.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service/axiosInstance.ts b/src/service/axiosInstance.ts index c312e59e..c5b155d9 100644 --- a/src/service/axiosInstance.ts +++ b/src/service/axiosInstance.ts @@ -32,7 +32,7 @@ const onError = (error: AxiosError) => { if (response?.data) { console.error(response.data); - if (response?.status === 400) { + if (response?.status === 400 || response?.status === 403) { window.location.href = '/signin'; } }