From c625754d1b2385028df96663cdb6f85eb750ef23 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Fri, 22 Jul 2022 15:44:40 +0100 Subject: [PATCH] Fix counting verifications --- app/src/api/services/building/verify.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/api/services/building/verify.ts b/app/src/api/services/building/verify.ts index b5482a76..dae64945 100644 --- a/app/src/api/services/building/verify.ts +++ b/app/src/api/services/building/verify.ts @@ -59,7 +59,8 @@ export async function getBuildingVerifications(building: BaseBuilding) { for (const item of verifications) { if (JSON.stringify(building[item.attribute]) == JSON.stringify(item.verified_value)) { - verified[item.attribute] = verified[item.attribute] ?? 0 + 1; + const count = verified[item.attribute] || 0; + verified[item.attribute] = count + 1; } } return verified;