From 44445734ba4a0f05564f808c2fd34a7f23c6fafb Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Wed, 20 May 2026 10:16:50 +0200 Subject: Let's do a rewrite! Created project structure and changed `build.zig` and added licence. --- static/api/rest.js | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 static/api/rest.js (limited to 'static/api/rest.js') diff --git a/static/api/rest.js b/static/api/rest.js deleted file mode 100644 index 6b14034..0000000 --- a/static/api/rest.js +++ /dev/null @@ -1,22 +0,0 @@ - -async function handle_fetch(promise) { - const result = await promise; - const json = await result.json(); - - if (!result.ok) { - throw json; - } - - return json; -} - -export function get(url) { - return handle_fetch(fetch(url)); -} - -export function post(url, body) { - return handle_fetch(fetch(url, { - method: 'POST', - body: JSON.stringify(body), - })); -} -- cgit v1.2.3-70-g09d2