task(F2-frontend): library search, favorites section, star toggle, svg thumbnails, grid view

This commit is contained in:
Agent Zero
2026-08-28 13:27:57 +02:00
parent 83a94e4f42
commit 8b50c0a612
3 changed files with 264 additions and 76 deletions
+12
View File
@@ -660,6 +660,7 @@ export interface GlobalBlock {
name: string;
block_data: string;
svg_data: string | null;
is_favorite: boolean;
created_at: string;
updated_at: string;
}
@@ -698,6 +699,17 @@ export async function renameGlobalBlock(token: string, id: string, name: string)
return res.json();
}
// Task F2: Favorite-Toggle für globale Blöcke
export async function setGlobalBlockFavorite(token: string, id: string, isFavorite: boolean): Promise<GlobalBlock> {
const res = await fetch(`${API_BASE}/api/global-blocks/${id}`, {
method: 'PATCH',
headers: authHeaders(token),
body: JSON.stringify({ is_favorite: isFavorite }),
});
if (!res.ok) throw new Error('Failed to set favorite');
return res.json();
}
export async function deleteGlobalBlock(token: string, id: string): Promise<void> {
const res = await fetch(`${API_BASE}/api/global-blocks/${id}`, {
method: 'DELETE',