From 411c932e8cb6b19eacb229236c9c7eac3d48bb1e Mon Sep 17 00:00:00 2001 From: rcmenno <129762469+rcmenno@users.noreply.github.com> Date: Mon, 14 Oct 2024 10:58:09 +0200 Subject: [PATCH] Leverage more templates bump 0.3.0 --- PWA/package.json | 2 +- .../FetchEventHandlers/UploadDataHandler.js | 3 +- PWA/public/index.html | 2 +- PWA/public/upload_data.html | 119 ++---------------- PWA/public/upload_error.html | 117 ++--------------- .../FetchEventHandlers/UploadDataHandler.ts | 3 +- 6 files changed, 30 insertions(+), 216 deletions(-) diff --git a/PWA/package.json b/PWA/package.json index 296bcf5..d0e48a8 100644 --- a/PWA/package.json +++ b/PWA/package.json @@ -1,6 +1,6 @@ { "name": "ReliefBox", - "version": "0.2.0", + "version": "0.3.0", "description": "A tool for managing the distribution of relief items during humanitarian emergencies.", "main": "index.js", "scripts": { diff --git a/PWA/public/Services/FetchEventHandlers/UploadDataHandler.js b/PWA/public/Services/FetchEventHandlers/UploadDataHandler.js index b8d07be..2ff1cc2 100644 --- a/PWA/public/Services/FetchEventHandlers/UploadDataHandler.js +++ b/PWA/public/Services/FetchEventHandlers/UploadDataHandler.js @@ -1,9 +1,10 @@ import { RouteEvents } from "../../RouteEvents.js"; +import { ResponseTools } from "../ResponseTools.js"; export class UploadDataHandler { canHandleEvent(event) { return event.request.url.endsWith("/upload_data?"); } async handleEvent(event) { - return fetch(RouteEvents.uploadData); + return ResponseTools.wrapInHtmlTemplate(RouteEvents.uploadData); } } diff --git a/PWA/public/index.html b/PWA/public/index.html index 2556584..a1db876 100644 --- a/PWA/public/index.html +++ b/PWA/public/index.html @@ -39,7 +39,7 @@ -
+ diff --git a/PWA/public/upload_data.html b/PWA/public/upload_data.html index d9d00ef..434ffee 100644 --- a/PWA/public/upload_data.html +++ b/PWA/public/upload_data.html @@ -1,109 +1,14 @@ - - - - - - - - -