rez_core 5.0.94 → 5.0.96

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "5.0.94",
3
+ "version": "5.0.96",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -581,24 +581,29 @@ export class EntityDynamicService {
581
581
  ): Promise<any> {
582
582
  const organizationId = loggedInUser.organization_id;
583
583
 
584
- const tableName = await this.getTableName(entityType, organizationId);
585
- const dataSource = await this.getEntitySourceTableName(
586
- entityType,
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
 
594
- const columns = validAttributes
595
- .map((attr) => `t.${attr.attribute_key}`)
596
- .join(', ');
597
- const selectQuery = `SELECT ${columns}
598
- FROM ${tableName} t
599
- WHERE id = $1`;
592
+ const entityRepo = this.reflectionHelper.getRepoService(entityMaster?.entity_data_class);
600
593
 
601
- const result = await this.entityManager.query(selectQuery, [id]);
594
+ const columns = validAttributes.map(attr => `${attr.attribute_key}`);
595
+
596
+ const result = await entityRepo.find({
597
+ where: {
598
+ id: id
599
+ },
600
+ select: columns
601
+ });
602
+ // const selectQuery = `SELECT ${columns}
603
+ // FROM ${tableName} t
604
+ // WHERE id = $1`;
605
+
606
+ // const result = await this.entityManager.query(selectQuery, [id]);
602
607
  if (!result.length) return null;
603
608
 
604
609
  const row = result[0];