Skip to content

Commit

Permalink
[TM] lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
egrojMonroy committed Dec 31, 2024
1 parent 50f9be7 commit f8cf719
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit f8cf719

Please sign in to comment.