Skip to content

Commit c48896d

Browse files
committed
IOT-1165: Filter 'null' from search results
1 parent 9013a69 commit c48896d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/services/data-management/search.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ export class SearchService {
3030
const applicationPromise = this.findApplicationsAndMapType(req, trimmedQuery);
3131
const devicePromise = this.findDevicesAndMapType(req, trimmedQuery);
3232

33-
const results = _.flatMap(
34-
await Promise.all([applicationPromise, devicePromise, gatewayPromise])
33+
const results = _.filter(
34+
_.flatMap(
35+
await Promise.all([applicationPromise, devicePromise, gatewayPromise])
36+
),
37+
x => x != null
3538
);
3639

3740
return {

0 commit comments

Comments
 (0)