mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-23 20:37:42 +02:00
optimize ND/JF list fetch
- no longer requires 2 separate fetches for count and data - the list count includes the first page so we set the query data directly
This commit is contained in:
@@ -32,15 +32,15 @@ export const AlbumArtistListPaginatedGrid = ({
|
||||
serverId,
|
||||
size,
|
||||
}: AlbumArtistListPaginatedGridProps) => {
|
||||
const { currentPage, onChange } = useItemListPagination();
|
||||
|
||||
const listCountQuery = artistsQueries.albumArtistListCount({
|
||||
query: { ...query },
|
||||
query: { ...query, limit: itemsPerPage },
|
||||
serverId: serverId,
|
||||
}) as UseSuspenseQueryOptions<number, Error, number, readonly unknown[]>;
|
||||
|
||||
const listQueryFn = api.controller.getAlbumArtistList;
|
||||
|
||||
const { currentPage, onChange } = useItemListPagination();
|
||||
|
||||
const { data, pageCount, totalItemCount } = useItemListPaginatedLoader({
|
||||
currentPage,
|
||||
eventKey: ItemListKey.ALBUM_ARTIST,
|
||||
|
||||
Reference in New Issue
Block a user