Fix bad compliance report PUT

Avoid attempting to PUT the location when we don't have a report URI
This commit is contained in:
Eli Ribble 2026-04-10 20:29:38 +00:00
parent 12aedaf543
commit e04b86218d
No known key found for this signature in database

View file

@ -138,6 +138,7 @@ async function createReport(client_id: string, loc?: GeolocationPosition) {
}
const body = await resp.json();
storeLocal.setExistingComplianceReportURI(body.uri);
compliance.value.uri = body.uri;
}
function doAddress() {
console.log("address done", compliance.value.address);
@ -175,6 +176,10 @@ async function fetchExistingReport(report_uri: string) {
isLoading.value = false;
}
async function updateReport(updates: ComplianceUpdate) {
if (!compliance.value.uri) {
console.log("Refusing to update report without URI");
return;
}
const resp = await fetch(compliance.value.uri, {
method: "PUT",
body: JSON.stringify(updates),