From 00ac28aebf0fd982e98987a059da52d3606382ba Mon Sep 17 00:00:00 2001 From: Tim Aldinger Date: Thu, 15 Oct 2026 11:38:19 +0200 Subject: [PATCH] wsp --- src/main/resources/static/js/models/ShoppingCategory.js | 1 - src/main/resources/static/js/pages/list/api/categoryAPI.js | 1 - src/main/resources/static/js/pages/list/api/itemAPI.js | 7 ------- src/main/resources/static/js/shared/helper.js | 1 - src/main/resources/static/js/shared/sharedUI.js | 4 ---- 5 files changed, 14 deletions(-) diff --git a/src/main/resources/static/js/models/ShoppingCategory.js b/src/main/resources/static/js/models/ShoppingCategory.js index b0c5d1e..dae39d5 100644 --- a/src/main/resources/static/js/models/ShoppingCategory.js +++ b/src/main/resources/static/js/models/ShoppingCategory.js @@ -1,4 +1,3 @@ - export class ShoppingCategory extends HTMLElement { static get observedAttributes() { return ["category-name"] } diff --git a/src/main/resources/static/js/pages/list/api/categoryAPI.js b/src/main/resources/static/js/pages/list/api/categoryAPI.js index a5d7350..99d3e29 100644 --- a/src/main/resources/static/js/pages/list/api/categoryAPI.js +++ b/src/main/resources/static/js/pages/list/api/categoryAPI.js @@ -7,7 +7,6 @@ export async function addCategory(listID, categoryName) { }); } - export async function editCategory(categoryID, toChange) { return await fetch(`/api/categories/${categoryID}`, { diff --git a/src/main/resources/static/js/pages/list/api/itemAPI.js b/src/main/resources/static/js/pages/list/api/itemAPI.js index 63bcf8e..7a30373 100644 --- a/src/main/resources/static/js/pages/list/api/itemAPI.js +++ b/src/main/resources/static/js/pages/list/api/itemAPI.js @@ -1,5 +1,3 @@ - - export async function addItem(listID, itemName, itemAmount, categoryID) { return await fetch(`/api/items`, { @@ -14,7 +12,6 @@ export async function addItem(listID, itemName, itemAmount, categoryID) { }); } - export async function deleteItem(itemID) { return await fetch(`/api/items/${itemID}`, { method: "DELETE" }); @@ -32,9 +29,5 @@ export async function editItem(itemID, toChange) { } export async function deleteAllDoneItems(listID) { - return await fetch(`/api/lists/${listID}/items?done=true`, { method: "DELETE" }); - - } - diff --git a/src/main/resources/static/js/shared/helper.js b/src/main/resources/static/js/shared/helper.js index 6164bc0..26f4b29 100644 --- a/src/main/resources/static/js/shared/helper.js +++ b/src/main/resources/static/js/shared/helper.js @@ -1,6 +1,5 @@ import { showError } from "./error.js"; - export async function handleResponse(promise, errorMsg) { const response = await promise; diff --git a/src/main/resources/static/js/shared/sharedUI.js b/src/main/resources/static/js/shared/sharedUI.js index c77a80f..71e5437 100644 --- a/src/main/resources/static/js/shared/sharedUI.js +++ b/src/main/resources/static/js/shared/sharedUI.js @@ -1,9 +1,7 @@ - export function abortEditing(formElement, old) { formElement.replaceWith(old); } - export function createEditForm(fields) { const editForm = document.createElement("form"); const abortButton = document.createElement("button"); @@ -31,10 +29,8 @@ export function createEditForm(fields) { return editForm; } - export function setElementAttributes(element, attributes) { for (const [attr, val] of Object.entries(attributes)) element.setAttribute(attr, val); } -