pl-fe: migrate status quotes list to tanstack query

Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
mkljczk
2024-11-30 20:47:03 +01:00
parent d95a78085e
commit a99c61d454
7 changed files with 43 additions and 322 deletions

View File

@ -11,7 +11,7 @@ const useStatusQuotes = (statusId: string) => {
const { client } = usePlHooksApiClient();
return useInfiniteQuery({
queryKey: ['statusesLists', 'quotes', statusId],
queryKey: ['statusLists', 'quotes', statusId],
queryFn: ({ pageParam }) => pageParam.next?.() || client.statuses.getStatusQuotes(statusId).then(minifyStatusList),
initialPageParam: { previous: null, next: null, items: [], partial: false } as PaginatedResponse<string>,
getNextPageParam: (page) => page.next ? page : undefined,