-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 비로그인 사용자 또는 신청한 봉사인 경우 봉사신청 버튼 disabled (#258)
* feat(volunteer): 봉사모집신청여부 조회 api 추가 * feat(volunteer): 봉사모집상세조회 fetch hook useQueries 변경, 신청 여부 fetch 추가 * feat(volunteer): 신청여부에 따라 봉사신청버튼 비활성화, 비로그인유저 신청버튼 클릭 시 로그인하기 모달 * feat(volunteer): 봉사신청 여부 조회 mock api 추가 * fix(volunteer): 모집마감일이 지나면 모집마감
- Loading branch information
Showing
4 changed files
with
101 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 15 additions & 4 deletions
19
apps/volunteer/src/pages/volunteers/detail/_hooks/useFetchRecruitmentDetail.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
import { useSuspenseQuery } from '@tanstack/react-query'; | ||
import { useSuspenseQueries } from '@tanstack/react-query'; | ||
import { getRecruitmentDetail } from 'shared/apis/common/Recruitments'; | ||
|
||
import { getIsAppliedRecruitment } from '@/apis/recruitment'; | ||
|
||
const useFetchRecruitmentDetail = (recruitmentId: number) => | ||
useSuspenseQuery({ | ||
queryKey: ['recruitment', recruitmentId], | ||
queryFn: async () => (await getRecruitmentDetail(recruitmentId)).data, | ||
useSuspenseQueries({ | ||
queries: [ | ||
{ | ||
queryKey: ['recruitment', recruitmentId], | ||
queryFn: async () => (await getRecruitmentDetail(recruitmentId)).data, | ||
}, | ||
{ | ||
queryKey: ['recruitment', recruitmentId, 'isApplied'], | ||
queryFn: async () => | ||
(await getIsAppliedRecruitment(recruitmentId)).data, | ||
}, | ||
], | ||
}); | ||
export default useFetchRecruitmentDetail; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters