mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
Add types to query keys object
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { QueryFunctionContext } from '@tanstack/react-query';
|
||||||
import type {
|
import type {
|
||||||
AlbumListQuery,
|
AlbumListQuery,
|
||||||
SongListQuery,
|
SongListQuery,
|
||||||
@@ -14,7 +15,10 @@ import type {
|
|||||||
SongDetailQuery,
|
SongDetailQuery,
|
||||||
} from './types';
|
} from './types';
|
||||||
|
|
||||||
export const queryKeys = {
|
export const queryKeys: Record<
|
||||||
|
string,
|
||||||
|
Record<string, (...props: any) => QueryFunctionContext['queryKey']>
|
||||||
|
> = {
|
||||||
albumArtists: {
|
albumArtists: {
|
||||||
detail: (serverId: string, query?: AlbumArtistDetailQuery) => {
|
detail: (serverId: string, query?: AlbumArtistDetailQuery) => {
|
||||||
if (query) return [serverId, 'albumArtists', 'detail', query] as const;
|
if (query) return [serverId, 'albumArtists', 'detail', query] as const;
|
||||||
|
|||||||
Reference in New Issue
Block a user