diff --git a/src/api/post.ts b/src/api/post.ts index f58f0c7e..b07f200d 100644 --- a/src/api/post.ts +++ b/src/api/post.ts @@ -8,13 +8,16 @@ export const getPostDetail = async (id: number) => { }; // 4.6 (고용주) 공고에 대한 지원자 리스트 조회 -// TODO: 정렬값 추가 필요 -export const getApplicantList = async (id: number) => { +export const getApplicantList = async ( + id: number, + sorting: string, + status: string, +) => { // TODO: 무한 스크롤 구현하기 const page = 1; const size = 10; const response = await api.get( - `/api/v1/owners/job-postings/${id}/user-owner-job-postings/users/overviews?page=${page}&size=${size}`, + `/api/v1/owners/job-postings/${id}/user-owner-job-postings/users/overviews?page=${page}&size=${size}&sorting=${sorting}&status=${status}`, ); return response.data; }; diff --git a/src/hooks/api/usePost.ts b/src/hooks/api/usePost.ts index 45bfc0cc..d0b10709 100644 --- a/src/hooks/api/usePost.ts +++ b/src/hooks/api/usePost.ts @@ -15,10 +15,14 @@ export const useGetPostDetail = (id: number) => { }; // 4.6 (고용주) 공고에 대한 지원자 리스트 조회 훅 -export const useGetApplicantList = (id: number) => { +export const useGetApplicantList = ( + id: number, + sorting: string, + status: string, +) => { return useQuery({ queryKey: ['post', id], - queryFn: () => getApplicantList(id), + queryFn: () => getApplicantList(id, sorting, status), }); };