Skip to content

Commit dc6e746

Browse files
authored
simplify parent_id check
1 parent ebc9e56 commit dc6e746

File tree

1 file changed

+2
-3
lines changed
  • src/placeos-rest-api/controllers

1 file changed

+2
-3
lines changed

src/placeos-rest-api/controllers/zones.cr

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,9 @@ module PlaceOS::Api
106106
query.sort(NAME_SORT_ASC)
107107

108108
# Limit results to the children of these parents (OR logic)
109-
if parent = parent_id
110-
parent_ids = parent.map(&.strip).reject(&.empty?)
109+
if parent_id
111110
query.should({
112-
"parent_id" => parent_ids,
111+
"parent_id" => parent_id,
113112
})
114113
query.minimum_should_match(1)
115114
end

0 commit comments

Comments
 (0)