Skip to content

Commit 60e1e21

Browse files
authored
Merge pull request #459 from glassbead0/return_all_areas_in_bulk_query
feat: return all leaf+non-leaf areas
2 parents 017d28a + f9b993b commit 60e1e21

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/model/AreaDataSource.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ export default class AreaDataSource extends MongoDataSource<AreaType> {
287287
})
288288
}
289289
const ancestorsCSV = ancestors.join(',')
290-
return await this.findDescendantsByPath(ancestorsCSV)
290+
const [leafAreas, nonLeafAreas] = await Promise.all([
291+
this.findDescendantsByPath(ancestorsCSV, true),
292+
this.findDescendantsByPath(ancestorsCSV, false)
293+
])
294+
return nonLeafAreas.concat(leafAreas)
291295
}
292296
}

0 commit comments

Comments
 (0)