feat(web): add home/albums/artists API clients for M6a
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { createQuery } from '@tanstack/svelte-query';
|
||||
import { api } from './client';
|
||||
import { qk } from './queries';
|
||||
import type { TrackRef } from './types';
|
||||
|
||||
export async function listArtistTracks(artistId: string): Promise<TrackRef[]> {
|
||||
return api.get<TrackRef[]>(`/api/artists/${artistId}/tracks`);
|
||||
}
|
||||
|
||||
export function createArtistTracksQuery(artistId: string) {
|
||||
return createQuery({
|
||||
queryKey: qk.artistTracks(artistId),
|
||||
queryFn: () => listArtistTracks(artistId),
|
||||
enabled: artistId.length > 0
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user