mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-18 06:07:48 +00:00
refactor: version 2.0 (React)
This commit is contained in:
parent
7dad7d810a
commit
950f72d4e8
356 changed files with 7901 additions and 29547 deletions
19
packages/renderer/src/hooks/useUserPlaylists.ts
Normal file
19
packages/renderer/src/hooks/useUserPlaylists.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import type { FetchUserPlaylistsParams } 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
|
||||
),
|
||||
}
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue