From a189348b360ebb9e622183bc3e58e713904a23ef Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Mon, 13 Apr 2026 23:51:43 +0000 Subject: [PATCH] Remove existing report URI when submission completes --- ts/rmo/view/Compliance.vue | 13 +++++++++++-- ts/store/local.ts | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ts/rmo/view/Compliance.vue b/ts/rmo/view/Compliance.vue index 8993d5b1..889dee65 100644 --- a/ts/rmo/view/Compliance.vue +++ b/ts/rmo/view/Compliance.vue @@ -26,9 +26,10 @@ body > .container-fluid { :is="Component" :district="district" @doAddress="doAddress" - @doEvidence="doEvidence" @doContact="doContact" + @doEvidence="doEvidence" @doPermission="doPermission" + @doSubmit="doSubmit" v-model="report" /> @@ -127,7 +128,11 @@ function doContact() { console.log("can't do contact, null report"); return; } - console.log("contact", report.value.reporter); + console.log( + "contact", + JSON.stringify(report.value.reporter), + report.value.reporter, + ); updateReport({ reporter: report.value.reporter, }); @@ -147,6 +152,10 @@ function doPermission() { wants_scheduled: report.value.wants_scheduled, }); } +function doSubmit() { + console.log("submit", report.value); + storeLocal.delExistingComplianceReportURI(); +} async function fetchExistingReport(report_uri: string) { isLoading.value = true; const resp = await fetch(report_uri); diff --git a/ts/store/local.ts b/ts/store/local.ts index 41f59a34..39023905 100644 --- a/ts/store/local.ts +++ b/ts/store/local.ts @@ -1,6 +1,9 @@ import { defineStore } from "pinia"; export const useStoreLocal = defineStore("local", () => { + function delExistingComplianceReportURI() { + localStorage.removeItem("working_compilance_report_uri"); + } function getClientID(): string { let id = localStorage.getItem("session_id"); if (id) { @@ -17,6 +20,7 @@ export const useStoreLocal = defineStore("local", () => { localStorage.setItem("working_compilance_report_uri", uri); } return { + delExistingComplianceReportURI, getClientID, getExistingComplianceReportURI, setExistingComplianceReportURI,