mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2025-03-01 12:57:25 +08:00
15 lines
445 B
TypeScript
15 lines
445 B
TypeScript
![]() |
import { fetchArtist } from '@/api/artist'
|
||
|
import { ArtistApiNames } from '@/api/artist'
|
||
|
import type { FetchArtistParams } from '@/api/artist'
|
||
|
|
||
|
export default function useArtist(params: FetchArtistParams, noCache: boolean) {
|
||
|
return useQuery(
|
||
|
[ArtistApiNames.FETCH_ARTIST, params],
|
||
|
() => fetchArtist(params, noCache),
|
||
|
{
|
||
|
enabled: !!params.id && params.id > 0 && !isNaN(Number(params.id)),
|
||
|
staleTime: 3600000,
|
||
|
}
|
||
|
)
|
||
|
}
|