Skip to content

Commit

Permalink
✨feat: 4.6 지원자 리스트 조회 api 쿼리 params 추가하기 #50
Browse files Browse the repository at this point in the history
  • Loading branch information
naarang committed Oct 26, 2024
1 parent 972c07b commit 9c88175
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/api/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
8 changes: 6 additions & 2 deletions src/hooks/api/usePost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
});
};

Expand Down

0 comments on commit 9c88175

Please sign in to comment.