Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.

Commit 4ef950b

Browse files
committed
fix(SearchController): filter out null values from users and games in globalSearch response
1 parent 4d9252b commit 4ef950b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

dist/controllers/SearchController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ let SearchController = class SearchController {
7272
games: filteredGames.length
7373
}
7474
});
75-
res.send({ users: detailledUsers, items, games: filteredGames });
75+
res.send({ users: detailledUsers.filter(u => u !== null), items, games: filteredGames.filter(g => g !== null) });
7676
}
7777
catch (error) {
7878
const msg = error instanceof Error ? error.message : String(error);

src/controllers/SearchController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export class SearchController {
8484
}
8585
});
8686

87-
res.send({ users: detailledUsers, items, games: filteredGames });
87+
res.send({ users: detailledUsers.filter(u => u !== null), items, games: filteredGames.filter(g => g !== null) });
8888
} catch (error) {
8989
const msg = error instanceof Error ? error.message : String(error);
9090
await this.createLog(req, 'globalSearch', 'search', 500, undefined, {

0 commit comments

Comments
 (0)