Add beginnings of status page

This commit is contained in:
Eli Ribble 2026-04-08 22:54:20 +00:00
parent 2c0bfb9904
commit 37ce3183ca
No known key found for this signature in database
6 changed files with 413 additions and 10 deletions

View file

@ -1,6 +1,6 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type { Publicreport } from "@/type/api";
import { Publicreport, type PublicreportDTO } from "@/type/api";
export const useStorePublicreport = defineStore("publicreport", () => {
// State
@ -23,9 +23,10 @@ export const useStorePublicreport = defineStore("publicreport", () => {
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const body = await response.json();
_byID.value.set(id, body);
return body;
const body: PublicreportDTO = await response.json();
const report = Publicreport.fromJSON(body);
_byID.value.set(id, report);
return report;
} catch (err) {
console.error("Error loading users:", err);
throw err;