Nightly: Admin Emoji-Picker für Custom-Badges; Kategorien UI: Umbenennen/Löschen + Anlegen; Badges im UI dargestellt
This commit is contained in:
parent
8795657f69
commit
9e5ba70711
3 changed files with 81 additions and 16 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue