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
12 changes: 9 additions & 3 deletions src/module/entities/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ module.exports = class UserProjectsHelper {
value: entity._id,
...hierarchyLevels.reduce((entityTypeNameMap, entityType) => {
const relatedEntities = groupEntityMap.get(entity._id.toString()) || []
const matchingEntity = relatedEntities.find((relatedEntity) => relatedEntity.entityType === entityType)
const matchingEntity = relatedEntities.find(
(relatedEntity) => relatedEntity.entityType === entityType
)
if (matchingEntity) {
entityTypeNameMap[entityType] = matchingEntity?.metaInformation?.name
}
Expand Down Expand Up @@ -1023,7 +1025,11 @@ module.exports = class UserProjectsHelper {
}

// Retrieve entity documents based on the filterQuery
const entityDocuments = await entitiesQueries.entityDocuments(filterQuery, ['childHierarchyPath'])
const entityDocuments = await entitiesQueries.entityDocuments(filterQuery, [
'childHierarchyPath',
'entityType',
'metaInformation',
])

if (!entityDocuments.length > 0) {
throw {
Expand All @@ -1032,7 +1038,7 @@ module.exports = class UserProjectsHelper {
}
}

let result = []
// let result = [];

// if( rolesDocument[0].entityTypes[0].entityType === constants.common.STATE_ENTITY_TYPE ) {
// result = entityDocuments[0].childHierarchyPath;
Expand Down