mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2025-03-01 04:46:41 +08:00
20 lines
605 B
TypeScript
20 lines
605 B
TypeScript
import { fetchArtistMV } from '@/web/api/artist'
|
|
import { IpcChannels } from '@/shared/IpcChannels'
|
|
import { CacheAPIs } from '@/shared/CacheAPIs'
|
|
import { FetchArtistMVParams, ArtistApiNames, FetchArtistMVResponse } from '@/shared/api/Artist'
|
|
import { useQuery } from '@tanstack/react-query'
|
|
|
|
export default function useArtistMV(params: FetchArtistMVParams) {
|
|
return useQuery(
|
|
[ArtistApiNames.FetchArtistMV, params],
|
|
async () => {
|
|
const data = await fetchArtistMV(params)
|
|
return data
|
|
},
|
|
{
|
|
enabled: !!params.id && params.id !== 0,
|
|
staleTime: 3600000,
|
|
}
|
|
)
|
|
}
|