mirror of
https://github.com/Jellify-Music/App.git
synced 2026-02-21 03:08:38 -06:00
14 lines
477 B
TypeScript
14 lines
477 B
TypeScript
import { useQuery } from "@tanstack/react-query";
|
|
import { QueryKeys } from "../../enums/query-keys";
|
|
import { Api } from "@jellyfin/sdk";
|
|
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api"
|
|
import { useApi } from "../queries";
|
|
|
|
|
|
export const useImageByItemId = (artistId: string) => useQuery({
|
|
queryKey: [QueryKeys.ArtistById, artistId],
|
|
queryFn: (({ queryKey }) => {
|
|
|
|
return getItemsApi(useApi.data!).getItems({ ids: [queryKey[1]]});
|
|
})
|
|
}) |