Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API 마이그레이션 마무리 #953

Merged
merged 9 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/api/API_LEGACY/meeting/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,8 @@ export const useQueryGetMeetingPeopleList = ({
});
};

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