Nightly: Badge-Entfernen ohne Modal neuer Endpoint /badges/clear und UI-Button 'Badges entfernen'

This commit is contained in:
vibe-bot 2025-08-09 21:12:02 +02:00
parent fae25d7578
commit 85a148d45f
3 changed files with 35 additions and 23 deletions

View file

@ -63,6 +63,15 @@ export async function assignBadges(files: string[], add: string[], remove: strin
return res.json();
}
export async function clearBadges(files: string[]) {
const res = await fetch(`${API_BASE}/badges/clear`, {
method: 'POST', headers: { 'Content-Type': 'application/json' }, credentials: 'include',
body: JSON.stringify({ files })
});
if (!res.ok) throw new Error('Badges löschen fehlgeschlagen');
return res.json();
}
export async function fetchChannels(): Promise<VoiceChannelInfo[]> {
const res = await fetch(`${API_BASE}/channels`);
if (!res.ok) throw new Error('Fehler beim Laden der Channels');