Remove existing report URI when submission completes

This commit is contained in:
Eli Ribble 2026-04-13 23:51:43 +00:00
parent 8f494991e2
commit a189348b36
No known key found for this signature in database
2 changed files with 15 additions and 2 deletions

View file

@ -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"
/>
</LoadingOverlay>
@ -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);

View file

@ -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,