diff --git a/src/apis/apiClient.ts b/src/apis/apiClient.ts index 4766b55..399213c 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 @@ -240,7 +238,6 @@ export class ApiClient method: 'get', url: '/reservation/my/lessons', }); - console.log('신청클래스 싹다', response.data); return response.data; } @@ -273,7 +270,7 @@ export class ApiClient method: 'get', url: '/reservation/my/opened', }); - console.log(response); + return response.data; } @@ -285,8 +282,7 @@ export class ApiClient method: 'get', url: `/reservation/my/opened/${lesson_id}`, }); - console.log(lesson_id); - console.log(response); + return response.data; } @@ -303,7 +299,6 @@ export class ApiClient // 예약자 정보 async peopleList(lessondateId: PeopleListReqType) { - console.log('전달된 lessondate_id: ', lessondateId); const response = await this.axiosInstance.request< BaseResponseType >({ @@ -392,23 +387,25 @@ export class ApiClient return config; }, (error) => { - console.log(error); return Promise.reject(error); } ); - newInstance.interceptors.response.use((response) => { - if (response.status === 403) { - removeCookie('token'); - removeCookie('username'); - location.href = '/'; - } + newInstance.interceptors.response.use( + (response) => { + return response; + }, + (error) => { + 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/apis/imageApiClient.ts b/src/apis/imageApiClient.ts index 448cbe3..17c8fc6 100644 --- a/src/apis/imageApiClient.ts +++ b/src/apis/imageApiClient.ts @@ -12,7 +12,6 @@ export class ImageApiClient { // 이미지 업로드 async postLessonImg(formData: FormData) { - console.log('ddddfsdjf>>', formData); const response = await this.axiosImgInstance.request({ method: 'post', url: '/lesson/image-upload', @@ -55,7 +54,6 @@ export class ImageApiClient { return config; }, (error) => { - console.log(error); return Promise.reject(error); } ); 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 }) => {

{ return response; }, onSuccess: async (response) => { - console.log('성공'); if (response.data) { setMaterialPrice(response.data.materialPrice); setRentalPrice(response.data.rentalPrice); @@ -83,9 +82,7 @@ export const Calculator = ({ data, lessonId, year }: IProps) => { queryClient.invalidateQueries({ queryKey: ['monthRevenue'] }); } }, - onError: async () => { - console.log('에러'); - }, + onError: async () => {}, }); const saveEditPrice = () => { diff --git a/src/components/molecules/LessonSearchCard.tsx b/src/components/molecules/LessonSearchCard.tsx index c8d455a..5767ead 100644 --- a/src/components/molecules/LessonSearchCard.tsx +++ b/src/components/molecules/LessonSearchCard.tsx @@ -18,7 +18,7 @@ export const LessonSearchCard: FC = ({ lesson }) => {

-

+

{lesson.title}

diff --git a/src/components/molecules/MyCalendar.tsx b/src/components/molecules/MyCalendar.tsx index f158240..5c2b624 100644 --- a/src/components/molecules/MyCalendar.tsx +++ b/src/components/molecules/MyCalendar.tsx @@ -44,9 +44,7 @@ export const MyCalendar = ({ } }, [data]); - const handleOpenList = () => { - console.log(value); - }; + const handleOpenList = () => {}; useEffect(() => { onDateChange(new Date()); diff --git a/src/components/molecules/PasswordKeypad.tsx b/src/components/molecules/PasswordKeypad.tsx index 6c5776b..e453b7c 100644 --- a/src/components/molecules/PasswordKeypad.tsx +++ b/src/components/molecules/PasswordKeypad.tsx @@ -21,7 +21,7 @@ export const PasswordKeypad: FC = ({ {[1, -1, 2, -1, 3, 4, 5, 6, 7, 8, 9, 0].map((num, index) => ( ))}