From 1dd335e166b99779b62c524af264755eeff433ec Mon Sep 17 00:00:00 2001 From: Tim Aldinger Date: Wed, 14 Oct 2026 19:54:35 +0200 Subject: [PATCH] generishce editElement funktion implementiert --- src/main/resources/static/js/shared/sharedAPI.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/main/resources/static/js/shared/sharedAPI.js diff --git a/src/main/resources/static/js/shared/sharedAPI.js b/src/main/resources/static/js/shared/sharedAPI.js new file mode 100644 index 0000000..eb5a750 --- /dev/null +++ b/src/main/resources/static/js/shared/sharedAPI.js @@ -0,0 +1,8 @@ +export async function editElement(apiPath, toChange) { + return await fetch(apiPath, + { + method: "PATCH", + body: JSON.stringify(toChange), + headers: { "Content-Type": "application/json" } + }); +}