rez_core 5.0.94 → 5.0.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -581,24 +581,31 @@ export class EntityDynamicService {
|
|
|
581
581
|
): Promise<any> {
|
|
582
582
|
const organizationId = loggedInUser.organization_id;
|
|
583
583
|
|
|
584
|
-
const
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
organizationId,
|
|
588
|
-
);
|
|
584
|
+
const entityMaster = await this.entityMasterRepo.getEntityByMappedEntityType(entityType, organizationId);
|
|
585
|
+
if(!entityMaster) return null;
|
|
586
|
+
|
|
589
587
|
const validAttributes = await this.getAttributeCodes(
|
|
590
588
|
entityType,
|
|
591
589
|
organizationId,
|
|
592
590
|
);
|
|
593
591
|
|
|
592
|
+
const entityRepo = this.reflectionHelper.getRepoService(entityMaster?.entity_data_class);
|
|
593
|
+
|
|
594
594
|
const columns = validAttributes
|
|
595
595
|
.map((attr) => `t.${attr.attribute_key}`)
|
|
596
596
|
.join(', ');
|
|
597
|
-
const selectQuery = `SELECT ${columns}
|
|
598
|
-
FROM ${tableName} t
|
|
599
|
-
WHERE id = $1`;
|
|
600
597
|
|
|
601
|
-
const result = await
|
|
598
|
+
const result = await entityRepo.find({
|
|
599
|
+
where: {
|
|
600
|
+
id: id
|
|
601
|
+
},
|
|
602
|
+
select: [columns]
|
|
603
|
+
});
|
|
604
|
+
// const selectQuery = `SELECT ${columns}
|
|
605
|
+
// FROM ${tableName} t
|
|
606
|
+
// WHERE id = $1`;
|
|
607
|
+
|
|
608
|
+
// const result = await this.entityManager.query(selectQuery, [id]);
|
|
602
609
|
if (!result.length) return null;
|
|
603
610
|
|
|
604
611
|
const row = result[0];
|