diff --git a/src/api/API_LEGACY/meeting/hooks.ts b/src/api/API_LEGACY/meeting/hooks.ts index f939e129..dee083e7 100644 --- a/src/api/API_LEGACY/meeting/hooks.ts +++ b/src/api/API_LEGACY/meeting/hooks.ts @@ -117,10 +117,8 @@ export const useQueryGetMeetingPeopleList = ({ }); }; -export const useMutationDeleteMeeting = ({ - useMutationOptions, -}: UseMutateBody): UseMutationResult<{ statusCode: number }, AxiosError, number> => { - return useMutation<{ statusCode: number }, AxiosError, number>({ +export const useMutationDeleteMeeting = ({ useMutationOptions }: UseMutateBody) => { + return useMutation({ ...useMutationOptions, mutationKey: ['deleteMeeting'], mutationFn: deleteMeeting, diff --git a/src/api/API_LEGACY/meeting/index.ts b/src/api/API_LEGACY/meeting/index.ts index bea250f1..d75da39f 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): Promise<{ statusCode: number }> => { - return (await api.delete<{ statusCode: number }>(`/meeting/${id}`)).data; +export const deleteMeeting = async (id: number) => { + return (await api.delete(`/meeting/v2/${id}`)).data; }; export const postApplication = async (body: PostApplicationRequest): Promise<{ statusCode: number }> => { @@ -222,7 +222,7 @@ export const deleteApplication = async (meetingId: number): Promise<{ statusCode }; export const updateApplication = async ({ id, ...rest }: UpdateApplicationRequest) => { - return (await api.put(`/meeting/${id}/apply/status`, rest)).data; + return (await api.put(`/meeting/v2/${id}/apply/status`, rest)).data; }; const serializeFormData = (formData: FormType) => { diff --git a/src/api/auth/index.ts b/src/api/auth/index.ts index a7d4af28..38aaa073 100644 --- a/src/api/auth/index.ts +++ b/src/api/auth/index.ts @@ -1,13 +1,10 @@ -import { api, Data } from '..'; +import { paths } from '@/__generated__/schema2'; +import { api } from '..'; -interface GetCrewTokenResponse { - accessToken: string; -} +type GetCrewTokenResponse = paths['/auth/v2']['post']['responses']['201']['content']['application/json;charset=UTF-8']; export const getCrewToken = async (playgroundToken: string) => { - const { - data: { data }, - } = await api.post>(`/auth`, { + const { data } = await api.post(`/auth/v2`, { authToken: playgroundToken, }); return data;