fix(folders): API-Filter per folder + UI ruft Sounds je aktivem Tab ab; 'Alle' zeigt weiterhin alle
This commit is contained in:
parent
f9bec8b5a1
commit
1f0911c0f7
3 changed files with 9 additions and 3 deletions
|
|
@ -5,6 +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);
|
||||
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