From 9c9be14825094764476b1a252519ce7badb05875 Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Wed, 25 Oct 2023 10:17:29 +0100 Subject: [PATCH] fix: replace iterative approach for task feats, edit schema --- src/backend/app/projects/project_routes.py | 19 ------------------- src/backend/app/projects/project_schemas.py | 2 -- 2 files changed, 21 deletions(-) diff --git a/src/backend/app/projects/project_routes.py b/src/backend/app/projects/project_routes.py index 11b24eb0dd..fd951d440e 100644 --- a/src/backend/app/projects/project_routes.py +++ b/src/backend/app/projects/project_routes.py @@ -685,25 +685,6 @@ def get_project_features( feature(json): JSON object containing a list of features """ features = project_crud.get_project_features(db, project_id, task_id) - # Simplify the geojson to send (strip project_id & task_id to reduce size) - # TODO coordinate with frontend to remove the first level geometry key - # Only return geojson with properties: - # {'type': 'feature', 'geometry': {...}, 'properties': {...}} - features = [ - { - "id": feature["id"], - "geometry": { - "id": feature["geometry"]["id"], - "type": feature["geometry"]["type"], - "geometry": feature["geometry"]["geometry"], - "properties": { - "id": feature["geometry"]["properties"]["id"], - "building": feature["geometry"]["properties"]["building"], - }, - }, - } - for feature in features - ] return features diff --git a/src/backend/app/projects/project_schemas.py b/src/backend/app/projects/project_schemas.py index f0732142d8..9865e96f5a 100644 --- a/src/backend/app/projects/project_schemas.py +++ b/src/backend/app/projects/project_schemas.py @@ -57,8 +57,6 @@ class BETAProjectUpload(BaseModel): class Feature(BaseModel): id: int - project_id: int - task_id: Optional[int] = None geometry: Optional[GeojsonFeature] = None