Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/module/entities/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ module.exports = class UserProjectsHelper {
) {
return new Promise(async (resolve, reject) => {
try {
let aggregateData
let aggregateData, count
bodyQuery = UTILS.convertMongoIds(bodyQuery)

if (aggregateStaging == true) {
Expand Down Expand Up @@ -1262,6 +1262,8 @@ module.exports = class UserProjectsHelper {
}

let result = await entitiesQueries.getAggregate(aggregateData)
count = result[0].totalCount[0]?.count || 0

if (aggregateStaging == true) {
if (!Array.isArray(result) || !(result.length > 0)) {
throw {
Expand All @@ -1282,6 +1284,7 @@ module.exports = class UserProjectsHelper {
success: true,
message: CONSTANTS.apiResponses.ASSETS_FETCHED_SUCCESSFULLY,
result: result,
...(count !== undefined && { count }),
})
} catch (error) {
return reject(error)
Expand Down