Nightly: Admin Emoji-Picker für Custom-Badges; Kategorien UI: Umbenennen/Löschen + Anlegen; Badges im UI dargestellt

This commit is contained in:
vibe-bot 2025-08-09 17:30:21 +02:00
parent 8795657f69
commit 9e5ba70711
3 changed files with 81 additions and 16 deletions

View file

@ -28,6 +28,23 @@ export async function createCategory(name: string, color?: string) {
return res.json();
}
export async function updateCategory(id: string, payload: { name?: string; color?: string; sort?: number }) {
const res = await fetch(`${API_BASE}/categories/${encodeURIComponent(id)}`, {
method: 'PATCH', headers: { 'Content-Type': 'application/json' }, credentials: 'include',
body: JSON.stringify(payload)
});
if (!res.ok) throw new Error('Kategorie aktualisieren fehlgeschlagen');
return res.json();
}
export async function deleteCategory(id: string) {
const res = await fetch(`${API_BASE}/categories/${encodeURIComponent(id)}`, {
method: 'DELETE', credentials: 'include'
});
if (!res.ok) throw new Error('Kategorie löschen fehlgeschlagen');
return res.json();
}
export async function assignCategories(files: string[], add: string[], remove: string[] = []) {
const res = await fetch(`${API_BASE}/categories/assign`, {
method: 'POST', headers: { 'Content-Type': 'application/json' }, credentials: 'include',