fix(ui): Tabs filtern korrekt nach Folder; Soundzähler als Badge im Header
This commit is contained in:
parent
7920fa7abe
commit
0553fd5892
3 changed files with 12 additions and 10 deletions
|
|
@ -5,7 +5,7 @@ const API_BASE = import.meta.env.VITE_API_BASE_URL || '/api';
|
|||
export async function fetchSounds(q?: string, folderKey?: string): Promise<SoundsResponse> {
|
||||
const url = new URL(`${API_BASE}/sounds`, window.location.origin);
|
||||
if (q) url.searchParams.set('q', q);
|
||||
if (folderKey) url.searchParams.set('folder', folderKey);
|
||||
if (folderKey !== undefined) url.searchParams.set('folder', folderKey);
|
||||
const res = await fetch(url.toString());
|
||||
if (!res.ok) throw new Error('Fehler beim Laden der Sounds');
|
||||
return res.json();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue