feat: updates

This commit is contained in:
qier222 2022-08-03 23:48:39 +08:00
parent 47e41dea9b
commit ebebf2a733
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
160 changed files with 4148 additions and 2001 deletions

View file

@ -0,0 +1,30 @@
import { fetchArtistMV } from '@/web/api/artist'
import { IpcChannels } from '@/shared/IpcChannels'
import { APIs } 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,
// placeholderData: (): FetchArtistMVResponse =>
// window.ipcRenderer?.sendSync(IpcChannels.GetApiCacheSync, {
// api: APIs.ArtistAlbum,
// query: {
// id: params.id,
// },
// }),
}
)
}