deletItem ist asynch und gibt response-object zurück

This commit is contained in:
Technoir committed 2026-10-06 15:15:37 +02:00
1 parent 9e8202d382
commit fbd20f9089
1 file changed
+3 -3
+3 -3
View File
@@ -17,12 +17,12 @@ export async function addItem(listID, itemName, itemAmount, categoryID) {
}
export function deleteItem(itemID) {
export async function deleteItem(itemID) {
fetch(`/api/item/${itemID}`, { method: "DELETE" })
const response = await fetch(`/api/item/${itemID}`, { method: "DELETE" })
.then(r => console.log("item deleted"));
return 0;
return response;
}