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:
2026-05-01 20:13:49 -04:00
parent b1f2227d62
commit e674869e06
6 changed files with 145 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import { createQuery } from '@tanstack/svelte-query';
import { api } from './client';
import { qk } from './queries';
import type { HomePayload } from './types';
export async function listHome(): Promise<HomePayload> {
return api.get<HomePayload>('/api/home');
}
// staleTime = 60s — repeat home-page mounts within a minute reuse cached
// data. Like-state changes, new plays, freshly-added albums surface on
// the next refetch.
export function createHomeQuery() {
return createQuery({
queryKey: qk.home(),
queryFn: listHome,
staleTime: 60_000
});
}