-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 나눔 목록 조회 무한 스크롤 되도록 수정, 호출시 query parameter 추가 (#30)
* chore: ShareSortType, ShareStatusType 추가 * fix: 나눔 목록 조회 무한 스크롤 적용
- Loading branch information
1 parent
6cb7d77
commit c2a4313
Showing
4 changed files
with
69 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
import { type ShareStatusType, type ShareSortType } from '@/types/friendship'; | ||
import { queryKeys } from '../queryKeys'; | ||
import { useBaseQuery } from '../useBaseQuery'; | ||
import { useBaseInfiniteQuery } from '../useBaseInfiniteQuery'; | ||
|
||
const useGetShares = () => | ||
useBaseQuery<ShareData[]>(queryKeys.SHARES(), '/shares', true); | ||
const useGetShares = ({ | ||
sort, | ||
status, | ||
}: { | ||
sort: ShareSortType; | ||
status: ShareStatusType; | ||
}) => | ||
useBaseInfiniteQuery<ShareData[]>({ | ||
queryKey: queryKeys.SHARES(sort, status), | ||
url: '/shares', | ||
params: { sort, status }, | ||
}); | ||
|
||
export default useGetShares; |
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