feat: add deleteItem function to API for item removal

This commit is contained in:
Felix Zett 2025-08-30 20:26:10 +02:00
parent c3044638b5
commit dd2f62593a

View file

@ -50,6 +50,11 @@ export async function updateItemName(itemId: string, name: string): Promise<Item
return res.json();
}
export async function deleteItem(itemId: string): Promise<void> {
const res = await fetch(`${API_BASE}/items/${itemId}`, { method: "DELETE" });
if (!res.ok) throw new Error("Failed to delete item");
}
export async function deleteItemTag(itemId: string, tagId: string): Promise<Item> {
const res = await fetch(`${API_BASE}/items/${itemId}/tags/${tagId}`, {
method: "DELETE",