Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return [4 /*yield*/, here.getFamilyConnections(here.HierarchyControl.EntityId, 0, coveredEntities)];
case 1:
results = _b.sent();
for (_i = 0, _a = results.entities; _i < _a.length; _i++) {
entity = _a[_i];
he = this.parseJSONResponse(entity);
if (self_node.Line1 === undefined) {
self_node.Line1 = entity["from.fullname"];
}
if (entity._record2roleid_value === ConnectionRole.Parent.toLowerCase() || entity._record1roleid_value === ConnectionRole.Child.toLowerCase()) {
self_node.HierarchyParentEntityId = entity["to.contactid"];
// TODO: Replace placeholder with parent label
he.Line2 = "Parent";
}
if (entity["from.contactid"] === this.HierarchyControl.EntityId && self_node.ImgUrl === undefined) {
self_node.ImgUrl = entity["from.entityimage"] !== undefined ? "data:image/png;base64," + entity["from.entityimage"] : "";
}
hierarchyElements.push(he);
}
hierarchyElements.push(self_node);
this.HierarchyElements = hierarchyElements;
return [2 /*return*/, 0];
}
});
});