remove limit / startIndex from count query args

This commit is contained in:
jeffvli 2025-09-26 10:43:39 -07:00
parent 78fb9b5ab7
commit abd1d55f23
4 changed files with 30 additions and 11 deletions

View file

@ -4,7 +4,7 @@ import { api } from '/@/renderer/api';
import { queryKeys } from '/@/renderer/api/query-keys';
import { QueryHookArgs } from '/@/renderer/lib/react-query';
import { getServerById } from '/@/renderer/store';
import { AlbumDetailQuery, AlbumListQuery } from '/@/shared/types/domain-types';
import { AlbumDetailQuery, AlbumListQuery, ListCountQuery } from '/@/shared/types/domain-types';
export const albumQueries = {
detail: (args: QueryHookArgs<AlbumDetailQuery>) => {
@ -35,7 +35,7 @@ export const albumQueries = {
...args.options,
});
},
listCount: (args: QueryHookArgs<AlbumListQuery>) => {
listCount: (args: QueryHookArgs<ListCountQuery<AlbumListQuery>>) => {
return queryOptions({
queryFn: ({ signal }) => {
return api.controller.getAlbumListCount({

View file

@ -8,6 +8,7 @@ import {
AlbumArtistDetailQuery,
AlbumArtistListQuery,
ArtistListQuery,
ListCountQuery,
TopSongListQuery,
} from '/@/shared/types/domain-types';
@ -36,7 +37,7 @@ export const artistsQueries = {
...args.options,
});
},
albumArtistListCount: (args: QueryHookArgs<AlbumArtistListQuery>) => {
albumArtistListCount: (args: QueryHookArgs<ListCountQuery<AlbumArtistListQuery>>) => {
return queryOptions({
queryFn: ({ signal }) => {
return api.controller.getAlbumArtistListCount({
@ -51,7 +52,7 @@ export const artistsQueries = {
...args.options,
});
},
artistListCount: (args: QueryHookArgs<ArtistListQuery>) => {
artistListCount: (args: QueryHookArgs<ListCountQuery<ArtistListQuery>>) => {
return queryOptions({
queryFn: ({ signal }) => {
return api.controller.getArtistListCount({

View file

@ -5,7 +5,7 @@ import { controller } from '/@/renderer/api/controller';
import { queryKeys } from '/@/renderer/api/query-keys';
import { QueryHookArgs } from '/@/renderer/lib/react-query';
import { getServerById } from '/@/renderer/store';
import { SimilarSongsQuery, SongListQuery } from '/@/shared/types/domain-types';
import { ListCountQuery, SimilarSongsQuery, SongListQuery } from '/@/shared/types/domain-types';
export const songsQueries = {
list: (args: QueryHookArgs<SongListQuery>, imageSize?: number) => {
@ -22,7 +22,7 @@ export const songsQueries = {
...args.options,
});
},
listCount: (args: QueryHookArgs<SongListQuery>) => {
listCount: (args: QueryHookArgs<ListCountQuery<SongListQuery>>) => {
return queryOptions({
queryFn: ({ signal }) => {
const server = getServerById(args.serverId);