From f8cf7197cc7049494062d88a79aa01a9ca4b064d Mon Sep 17 00:00:00 2001 From: JORGE Date: Tue, 31 Dec 2024 12:22:11 -0400 Subject: [PATCH] [TM] lint fix --- .../TerrafundCreateGeometryController.php | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/V2/Terrafund/TerrafundCreateGeometryController.php b/app/Http/Controllers/V2/Terrafund/TerrafundCreateGeometryController.php index a4a5361e..e2ce818d 100755 --- a/app/Http/Controllers/V2/Terrafund/TerrafundCreateGeometryController.php +++ b/app/Http/Controllers/V2/Terrafund/TerrafundCreateGeometryController.php @@ -550,37 +550,38 @@ public function getCriteriaData(Request $request) public function getCriteriaDataForMultiple(Request $request) { $uuids = $request->input('uuids'); - - if (empty($uuids) || !is_array($uuids)) { + + if (empty($uuids) || ! is_array($uuids)) { return response()->json(['error' => 'Invalid or missing UUIDs array'], 400); } - + $response = []; - + foreach ($uuids as $uuid) { $geometry = PolygonGeometry::isUuid($uuid)->first(); - + if ($geometry === null) { $response[$uuid] = ['error' => 'Polygon not found for the given UUID']; + continue; } - + $criteriaList = GeometryHelper::getCriteriaDataForPolygonGeometry($geometry); - + if (empty($criteriaList)) { $response[$uuid] = ['error' => 'Criteria data not found for the given polygon ID']; + continue; } - + $response[$uuid] = [ 'polygon_id' => $uuid, - 'criteria_list' => $criteriaList + 'criteria_list' => $criteriaList, ]; } - + return response()->json($response); } - public function getCriteriaDataForMultiplePolygons(array $uuids) {