diff --git a/src/apis/apiClient.ts b/src/apis/apiClient.ts index 4766b55..996eed5 100644 --- a/src/apis/apiClient.ts +++ b/src/apis/apiClient.ts @@ -7,8 +7,6 @@ import { hostApi } from './interfaces/hostApi'; import { categoryApi } from './interfaces/categoryApi'; import { transactionApi } from './interfaces/transactionApi'; import { reservationApi } from './interfaces/reservationApi'; -import { useNavigate } from 'react-router-dom'; -import { useModal } from '../context/ModalContext'; export class ApiClient implements @@ -397,18 +395,23 @@ export class ApiClient } ); - newInstance.interceptors.response.use((response) => { - if (response.status === 403) { - removeCookie('token'); - removeCookie('username'); - location.href = '/'; - } + newInstance.interceptors.response.use( + (response) => { + console.log('dd', response); + return response; + }, + (error) => { + console.log(error.response.status); + if (error.response.status === 403) { + alert('로그아웃되었습니다.'); + removeCookie('token'); + removeCookie('username'); + location.href = '/hana'; + } - if (response.status === 404) { - location.href = '/error'; + return Promise.reject(error); } - return response; - }); + ); return newInstance; }; diff --git a/src/components/molecules/AddLessonInput.tsx b/src/components/molecules/AddLessonInput.tsx index 56bc2d6..5b7e648 100644 --- a/src/components/molecules/AddLessonInput.tsx +++ b/src/components/molecules/AddLessonInput.tsx @@ -10,6 +10,13 @@ interface IProps { export const AddLessonInput = forwardRef( (props: IProps, ref: Ref) => { + const onInputNumber = (event: React.ChangeEvent) => { + if (props.type === 'number') { + event.target.value = event.target.value + .replace(/[^0-9.]/g, '') + .replace(/(\..*)\./g, ''); + } + }; return ( diff --git a/src/components/molecules/AddLessonTimeList.tsx b/src/components/molecules/AddLessonTimeList.tsx index 59ba1aa..f860620 100644 --- a/src/components/molecules/AddLessonTimeList.tsx +++ b/src/components/molecules/AddLessonTimeList.tsx @@ -124,7 +124,6 @@ export const AddLessonTimeList: FC = ({ onChangeTimes }) => {

= ({ {[1, -1, 2, -1, 3, 4, 5, 6, 7, 8, 9, 0].map((num, index) => ( ))}