Fix bad compliance report PUT
Avoid attempting to PUT the location when we don't have a report URI
This commit is contained in:
parent
12aedaf543
commit
e04b86218d
1 changed files with 5 additions and 0 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue