mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-17 17:04:16 +02:00
Lint all files
This commit is contained in:
@@ -6,21 +6,21 @@ import { getServerById } from '/@/renderer/store';
|
||||
import { api } from '/@/renderer/api';
|
||||
|
||||
export const usePlaylistList = (args: {
|
||||
options?: QueryOptions;
|
||||
query: PlaylistListQuery;
|
||||
serverId?: string;
|
||||
options?: QueryOptions;
|
||||
query: PlaylistListQuery;
|
||||
serverId?: string;
|
||||
}) => {
|
||||
const { options, query, serverId } = args;
|
||||
const server = getServerById(serverId);
|
||||
const { options, query, serverId } = args;
|
||||
const server = getServerById(serverId);
|
||||
|
||||
return useQuery({
|
||||
cacheTime: 1000 * 60 * 60,
|
||||
enabled: !!server?.id,
|
||||
queryFn: ({ signal }) => {
|
||||
if (!server) throw new Error('Server not found');
|
||||
return api.controller.getPlaylistList({ apiClientProps: { server, signal }, query });
|
||||
},
|
||||
queryKey: queryKeys.playlists.list(server?.id || '', query),
|
||||
...options,
|
||||
});
|
||||
return useQuery({
|
||||
cacheTime: 1000 * 60 * 60,
|
||||
enabled: !!server?.id,
|
||||
queryFn: ({ signal }) => {
|
||||
if (!server) throw new Error('Server not found');
|
||||
return api.controller.getPlaylistList({ apiClientProps: { server, signal }, query });
|
||||
},
|
||||
queryKey: queryKeys.playlists.list(server?.id || '', query),
|
||||
...options,
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user