-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 섹션 리스트 요청 엔드포인트 및 호출 로직 작성 * feat: react-query를 사용하여 섹션 리스트 요청 로직 구현 및 msw 모킹 * feat: 모아보기 리뷰 엔드포인트 및 호출 로직 작성 * fix: Dropdown 컴포넌트가 상태로 DropdownItem을 가지도록 수정 * feat: react-query를 사용하여 섹션별 모아보기 요청 로직 구현 및 msw 모킹 * fix: msw handler에 쿠키 확인하는 코드 추가 * feat: 형광펜 에디터 적용 및 인터페이스 수정 * chore: 불필요한 코드 제거
- Loading branch information
1 parent
7f02905
commit 82cd7b0
Showing
11 changed files
with
161 additions
and
26 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
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
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
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
26 changes: 26 additions & 0 deletions
26
frontend/src/pages/ReviewCollectionPage/hooks/useGetGroupedReviews.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useSuspenseQuery } from '@tanstack/react-query'; | ||
|
||
import { getGroupedReviews } from '@/apis/review'; | ||
import { REVIEW_QUERY_KEY } from '@/constants'; | ||
import { GroupedReviews } from '@/types'; | ||
|
||
interface UseGetGroupedReviewsProps { | ||
sectionId: number; | ||
} | ||
|
||
const useGetGroupedReviews = ({ sectionId }: UseGetGroupedReviewsProps) => { | ||
const fetchGroupedReviews = async () => { | ||
const result = await getGroupedReviews({ sectionId }); | ||
return result; | ||
}; | ||
|
||
const result = useSuspenseQuery<GroupedReviews>({ | ||
queryKey: [REVIEW_QUERY_KEY.groupedReviews, sectionId], | ||
queryFn: () => fetchGroupedReviews(), | ||
staleTime: 1 * 60 * 1000, | ||
}); | ||
|
||
return result; | ||
}; | ||
|
||
export default useGetGroupedReviews; |
22 changes: 22 additions & 0 deletions
22
frontend/src/pages/ReviewCollectionPage/hooks/useGetSectionList.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { useSuspenseQuery } from '@tanstack/react-query'; | ||
|
||
import { getSectionList } from '@/apis/review'; | ||
import { REVIEW_QUERY_KEY } from '@/constants'; | ||
import { GroupedSection } from '@/types'; | ||
|
||
const useGetSectionList = () => { | ||
const fetchSectionList = async () => { | ||
const result = await getSectionList(); | ||
return result; | ||
}; | ||
|
||
const result = useSuspenseQuery<GroupedSection>({ | ||
queryKey: [REVIEW_QUERY_KEY.sectionList], | ||
queryFn: () => fetchSectionList(), | ||
staleTime: 60 * 60 * 1000, | ||
}); | ||
|
||
return result; | ||
}; | ||
|
||
export default useGetSectionList; |
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