From 9c8817516b9a6d6f48d83e7d895c6019fa3185ee Mon Sep 17 00:00:00 2001 From: nakyong82 Date: Sun, 27 Oct 2024 01:28:50 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8feat:=204.6=20=EC=A7=80=EC=9B=90?= =?UTF-8?q?=EC=9E=90=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?api=20=EC=BF=BC=EB=A6=AC=20params=20=EC=B6=94=EA=B0=80=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20#50?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/post.ts | 9 ++++++--- src/hooks/api/usePost.ts | 8 ++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) 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), }); };