mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2025-03-01 12:29:40 +08:00
17 lines
511 B
TypeScript
17 lines
511 B
TypeScript
![]() |
import type { FetchUserAlbumsParams, FetchUserAlbumsResponse } from '@/api/user'
|
||
|
import { UserApiNames, fetchUserAlbums } from '@/api/user'
|
||
|
|
||
|
export default function useUserAlbums(params: FetchUserAlbumsParams) {
|
||
|
return useQuery(
|
||
|
[UserApiNames.FETCH_USER_ALBUMS, params],
|
||
|
() => fetchUserAlbums(params),
|
||
|
{
|
||
|
placeholderData: (): FetchUserAlbumsResponse =>
|
||
|
window.ipcRenderer?.sendSync('getApiCacheSync', {
|
||
|
api: 'album/sublist',
|
||
|
query: params,
|
||
|
}),
|
||
|
}
|
||
|
)
|
||
|
}
|