Skip to content

Commit

Permalink
Revert "API 마이그레이션 마무리 (#953)" (#954)
Browse files Browse the repository at this point in the history
This reverts commit 480c484.
  • Loading branch information
j-nary authored Nov 14, 2024
1 parent 480c484 commit 9c0e7f5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
6 changes: 4 additions & 2 deletions src/api/API_LEGACY/meeting/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ export const useQueryGetMeetingPeopleList = ({
});
};

export const useMutationDeleteMeeting = ({ useMutationOptions }: UseMutateBody<number>) => {
return useMutation({
export const useMutationDeleteMeeting = ({
useMutationOptions,
}: UseMutateBody<number>): UseMutationResult<{ statusCode: number }, AxiosError, number> => {
return useMutation<{ statusCode: number }, AxiosError, number>({
...useMutationOptions,
mutationKey: ['deleteMeeting'],
mutationFn: deleteMeeting,
Expand Down
6 changes: 3 additions & 3 deletions src/api/API_LEGACY/meeting/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }> => {
Expand All @@ -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) => {
Expand Down
11 changes: 7 additions & 4 deletions src/api/auth/index.ts
Original file line number Diff line number Diff line change
@@ -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<GetCrewTokenResponse>(`/auth/v2`, {
const {
data: { data },
} = await api.post<Data<GetCrewTokenResponse>>(`/auth`, {
authToken: playgroundToken,
});
return data;
Expand Down

0 comments on commit 9c0e7f5

Please sign in to comment.