set buildings table to current_landuse_group = True when verify clicked

This commit is contained in:
Ed Chalstrey 2022-05-05 13:22:05 +01:00
parent aa138198d8
commit 63c190c981

View File

@ -74,6 +74,15 @@ export async function updateBuildingUserVerifiedAttribute(buildingId: number, us
[buildingId, userId, attribute, value]
);
}
if (attribute == 'current_landuse_group'){
await (db).none(
`UPDATE buildings
SET current_landuse_verified = TRUE
WHERE buildings.building_id = $1;"
`,
[buildingId]
);
}
} catch(error) {
console.error(error)
if(error.detail?.includes('already exists')) {