diff --git a/app/src/api/services/building.ts b/app/src/api/services/building.ts index 3bb4bd55..c3c2c955 100644 --- a/app/src/api/services/building.ts +++ b/app/src/api/services/building.ts @@ -217,8 +217,8 @@ async function verifyBuildingAttributes(buildingId: number, userId: string, patc for (let [key, value] of Object.entries(patch)) { // check key in whitelist if(BUILDING_FIELD_WHITELIST.has(key)) { - // check value against current from database - if (value == building[key]) { + // check value against current from database - JSON.stringify as hack for "any" data type + if (JSON.stringify(value) == JSON.stringify(building[key])) { try { await verifyDataAccess.updateBuildingUserVerifiedAttribute(buildingId, userId, key, building[key]); verified[key] = building[key]; @@ -260,7 +260,7 @@ async function getBuildingVerifications(building) { } for (const item of verifications) { - if (building[item.attribute] == item.verified_value) { + if (JSON.stringify(building[item.attribute]) == JSON.stringify(item.verified_value)) { verified[item.attribute] += 1 } } diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index 976e3e58..a85f22e5 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -7,6 +7,7 @@ import MultiDataEntry from '../data-components/multi-data-entry/multi-data-entry import withCopyEdit from '../data-container'; import { CategoryViewProps } from './category-view-props'; +import Verification from '../data-components/verification'; /** * Use view/edit section @@ -29,6 +30,14 @@ const UseView: React.FunctionComponent = (props) => ( showAllOptionsOnEmpty={true} addOnAutofillSelect={true} /> + { props.mode != 'view' &&