mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Cleanup hooks
This commit is contained in:
parent
5b81d4a2fc
commit
cd19e9e5e1
3 changed files with 26 additions and 38 deletions
|
@ -35,19 +35,15 @@ export const useArtistsSearch = (
|
|||
|
||||
return useQuery({
|
||||
queryKey: ['ArtistsSearch', collectionType, parentId, searchTerm],
|
||||
queryFn: async ({ signal }) => {
|
||||
const artistsData = await fetchArtists(
|
||||
api!,
|
||||
userId!,
|
||||
{
|
||||
parentId: parentId,
|
||||
searchTerm: searchTerm
|
||||
},
|
||||
{ signal }
|
||||
);
|
||||
|
||||
return artistsData;
|
||||
},
|
||||
queryFn: ({ signal }) => fetchArtists(
|
||||
api!,
|
||||
userId!,
|
||||
{
|
||||
parentId: parentId,
|
||||
searchTerm: searchTerm
|
||||
},
|
||||
{ signal }
|
||||
),
|
||||
enabled: !!api && !!userId && (!collectionType || isMusic(collectionType))
|
||||
});
|
||||
};
|
||||
|
|
|
@ -37,18 +37,14 @@ export const usePeopleSearch = (
|
|||
|
||||
return useQuery({
|
||||
queryKey: ['PeopleSearch', collectionType, parentId, searchTerm],
|
||||
queryFn: async ({ signal }) => {
|
||||
const peopleData = await fetchPeople(
|
||||
api!,
|
||||
userId!,
|
||||
{
|
||||
searchTerm: searchTerm
|
||||
},
|
||||
{ signal }
|
||||
);
|
||||
|
||||
return peopleData;
|
||||
},
|
||||
queryFn: ({ signal }) => fetchPeople(
|
||||
api!,
|
||||
userId!,
|
||||
{
|
||||
searchTerm: searchTerm
|
||||
},
|
||||
{ signal }
|
||||
),
|
||||
enabled: !!api && !!userId && isPeopleEnabled
|
||||
});
|
||||
};
|
||||
|
|
|
@ -43,19 +43,15 @@ export const useVideoSearch = (
|
|||
|
||||
return useQuery({
|
||||
queryKey: ['VideoSearch', collectionType, parentId, searchTerm],
|
||||
queryFn: async ({ signal }) => {
|
||||
const videosData = await fetchPeople(
|
||||
api!,
|
||||
userId!,
|
||||
{
|
||||
parentId: parentId,
|
||||
searchTerm: searchTerm
|
||||
},
|
||||
{ signal }
|
||||
);
|
||||
|
||||
return videosData;
|
||||
},
|
||||
queryFn: ({ signal }) => fetchPeople(
|
||||
api!,
|
||||
userId!,
|
||||
{
|
||||
parentId: parentId,
|
||||
searchTerm: searchTerm
|
||||
},
|
||||
{ signal }
|
||||
),
|
||||
enabled: !!api && !!userId && !collectionType
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue