Skip to content

Commit 2d71cf3

Browse files
committed
Populate user information in api/search/software response
1 parent 1e47f48 commit 2d71cf3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

controllers/api/searchController.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const searchSoftware = async (req, res) => {
1313
const queryResponse = await Software.find(query)
1414
.sort({ name: 'asc' })
1515
.skip(page * perPage)
16-
.limit(perPage);
16+
.limit(perPage)
17+
.populate('meta.addedByUser', { username: 1, name: 1 })
18+
.populate('meta.updatedByUser', { username: 1, name: 1 });
1719

1820
const totalQueryResultCount = await Software.find(query).countDocuments();
1921

0 commit comments

Comments
 (0)