mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 21:58:03 +00:00
chore: 用esbuild代替vite来打包main
This commit is contained in:
parent
b4590c3c34
commit
c4219afd3d
152 changed files with 669 additions and 747 deletions
29
src/renderer/hooks/useUserPlaylists.ts
Normal file
29
src/renderer/hooks/useUserPlaylists.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import type {
|
||||
FetchUserPlaylistsParams,
|
||||
FetchUserPlaylistsResponse,
|
||||
} from '@/api/user'
|
||||
import { UserApiNames, fetchUserPlaylists } from '@/api/user'
|
||||
|
||||
export default function useUserPlaylists(params: FetchUserPlaylistsParams) {
|
||||
return useQuery(
|
||||
[UserApiNames.FETCH_USER_PLAYLISTS, params],
|
||||
async () => {
|
||||
const data = await fetchUserPlaylists(params)
|
||||
return data
|
||||
},
|
||||
{
|
||||
enabled: !!(
|
||||
!!params.uid &&
|
||||
params.uid !== 0 &&
|
||||
params.offset !== undefined
|
||||
),
|
||||
// placeholderData: (): FetchUserPlaylistsResponse =>
|
||||
// window.ipcRenderer.sendSync('getApiCacheSync', {
|
||||
// api: 'user/playlist',
|
||||
// query: {
|
||||
// uid: params.uid,
|
||||
// },
|
||||
// }),
|
||||
}
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue