From 0220547d53d7d2f52e67e995cbe644c23a403804 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 22 Apr 2022 13:54:21 +0100 Subject: [PATCH] modify buildings query to ignore demolished --- app/src/api/services/building/query.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/api/services/building/query.ts b/app/src/api/services/building/query.ts index dd3c8e5b..ccb67b86 100644 --- a/app/src/api/services/building/query.ts +++ b/app/src/api/services/building/query.ts @@ -7,6 +7,8 @@ export async function queryBuildingsAtPoint(lng: number, lat: number) { FROM buildings as b, geometries as g WHERE b.geometry_id = g.geometry_id + AND + b.latest_demolish_date IS NULL AND ST_Intersects( ST_Transform( @@ -45,6 +47,8 @@ export async function queryBuildingsByReference(key: string, ref: string) { buildings as b, building_properties as p WHERE b.building_id = p.building_id + AND + b.latest_demolish_date IS NULL AND p.uprn = $1 `,