From 9c0e7f54ec2111a6365bc5c5da4c6e13be1c40ec Mon Sep 17 00:00:00 2001 From: Lee jin <83453646+j-nary@users.noreply.github.com> Date: Thu, 14 Nov 2024 18:38:12 +0900 Subject: [PATCH] =?UTF-8?q?Revert=20"API=20=EB=A7=88=EC=9D=B4=EA=B7=B8?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=85=98=20=EB=A7=88=EB=AC=B4=EB=A6=AC=20(#9?= =?UTF-8?q?53)"=20(#954)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 480c4844788121a3528361006ec38a0959eb08a0. --- src/api/API_LEGACY/meeting/hooks.ts | 6 ++++-- src/api/API_LEGACY/meeting/index.ts | 6 +++--- src/api/auth/index.ts | 11 +++++++---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/api/API_LEGACY/meeting/hooks.ts b/src/api/API_LEGACY/meeting/hooks.ts index 5fbefe17..e0a414d2 100644 --- a/src/api/API_LEGACY/meeting/hooks.ts +++ b/src/api/API_LEGACY/meeting/hooks.ts @@ -118,8 +118,10 @@ export const useQueryGetMeetingPeopleList = ({ }); }; -export const useMutationDeleteMeeting = ({ useMutationOptions }: UseMutateBody) => { - return useMutation({ +export const useMutationDeleteMeeting = ({ + useMutationOptions, +}: UseMutateBody): UseMutationResult<{ statusCode: number }, AxiosError, number> => { + return useMutation<{ statusCode: number }, AxiosError, number>({ ...useMutationOptions, mutationKey: ['deleteMeeting'], mutationFn: deleteMeeting, diff --git a/src/api/API_LEGACY/meeting/index.ts b/src/api/API_LEGACY/meeting/index.ts index 6cfa4e97..b41aa6d4 100644 --- a/src/api/API_LEGACY/meeting/index.ts +++ b/src/api/API_LEGACY/meeting/index.ts @@ -209,8 +209,8 @@ export const getMeetingPeopleList = async ({ id, ...rest }: OptionData): Promise ).data.data; }; -export const deleteMeeting = async (id: number) => { - return (await api.delete(`/meeting/v2/${id}`)).data; +export const deleteMeeting = async (id: number): Promise<{ statusCode: number }> => { + return (await api.delete<{ statusCode: number }>(`/meeting/${id}`)).data; }; export const postApplication = async (body: PostApplicationRequest): Promise<{ statusCode: number }> => { @@ -226,7 +226,7 @@ export const deleteApplication = async (meetingId: number): Promise<{ statusCode }; export const updateApplication = async ({ id, ...rest }: UpdateApplicationRequest) => { - return (await api.put(`/meeting/v2/${id}/apply/status`, rest)).data; + return (await api.put(`/meeting/${id}/apply/status`, rest)).data; }; const serializeFormData = (formData: FormType) => { diff --git a/src/api/auth/index.ts b/src/api/auth/index.ts index 38aaa073..a7d4af28 100644 --- a/src/api/auth/index.ts +++ b/src/api/auth/index.ts @@ -1,10 +1,13 @@ -import { paths } from '@/__generated__/schema2'; -import { api } from '..'; +import { api, Data } from '..'; -type GetCrewTokenResponse = paths['/auth/v2']['post']['responses']['201']['content']['application/json;charset=UTF-8']; +interface GetCrewTokenResponse { + accessToken: string; +} export const getCrewToken = async (playgroundToken: string) => { - const { data } = await api.post(`/auth/v2`, { + const { + data: { data }, + } = await api.post>(`/auth`, { authToken: playgroundToken, }); return data;