diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 5e1f6474..146ae8d5 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -278,6 +278,9 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, + current_landuse_verified: { + edit: true, + }, dynamics_has_demolished_buildings: { edit: true, verify: true diff --git a/app/src/api/dataAccess/verify.ts b/app/src/api/dataAccess/verify.ts index 48bdd1c5..02e163d7 100644 --- a/app/src/api/dataAccess/verify.ts +++ b/app/src/api/dataAccess/verify.ts @@ -74,15 +74,6 @@ 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')) { @@ -96,15 +87,6 @@ export async function updateBuildingUserVerifiedAttribute(buildingId: number, us export async function removeBuildingUserVerifiedAttribute(buildingId: number, userId: string, attribute: string) : Promise { try { - if (attribute == 'current_landuse_group'){ - await (db).none( - `UPDATE buildings - SET current_landuse_verified = FALSE - WHERE buildings.building_id = $1; - `, - [buildingId] - ); - } return await (db).none( `DELETE FROM building_verification diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index fb886d7a..1d47c3bd 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -247,6 +247,13 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine this.setState({error: err}); } + if (slug == 'current_landuse_group'){ + const edits = { + 'current_landuse_verified': true + }; + + this.doSubmit(edits); + } console.log(slug + " verify button clicked") } diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index f808f000..95a46238 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -220,7 +220,11 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ tooltip: "URL for current land use reference", example: ["", "", ""], }, - + current_landuse_verified: { + category: Category.LandUse, + title: 'Has this land use been manually verified?', + example: true, + }, building_attachment_form: { category: Category.Type, title: "Adjacency/configuration",