rez_core 2.2.106 → 2.2.108

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": "2.2.106",
3
+ "version": "2.2.108",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -42,21 +42,38 @@ export class ResolverService {
42
42
  const resolvedValues: string[] = [];
43
43
 
44
44
  for (const code of codeValue) {
45
- const [item] = await this.dataSource.query(
46
- `SELECT * FROM ${tableName} WHERE code = ? AND organization_id = ?`,
47
- [code, loggedInUser.organization_id],
48
- );
49
- resolvedValues.push(item?.[attr.data_source_attribute] ?? code);
45
+ if (tableName == 'cr_organization') {
46
+ const [item] = await this.dataSource.query(
47
+ `SELECT * FROM ${tableName} WHERE code = ?`,
48
+ [code],
49
+ );
50
+ resolvedValues.push(item?.[attr.data_source_attribute] ?? code);
51
+ } else {
52
+ const [item] = await this.dataSource.query(
53
+ `SELECT * FROM ${tableName} WHERE code = ? AND organization_id = ?`,
54
+ [code, loggedInUser.organization_id],
55
+ );
56
+ resolvedValues.push(item?.[attr.data_source_attribute] ?? code);
57
+ }
50
58
  }
51
59
 
52
60
  resolvedEntityData[field] = resolvedValues;
53
61
  } else {
54
- const [item] = await this.dataSource.query(
55
- `SELECT * FROM ${tableName} WHERE id = ? AND organization_id = ?`,
56
- [codeValue, loggedInUser.organization_id],
57
- );
58
- resolvedEntityData[field] =
59
- item?.[attr.data_source_attribute] ?? codeValue;
62
+ if (tableName == 'cr_organization') {
63
+ const [item] = await this.dataSource.query(
64
+ `SELECT * FROM ${tableName} WHERE code = ?`,
65
+ [codeValue],
66
+ );
67
+ resolvedEntityData[field] =
68
+ item?.[attr.data_source_attribute] ?? codeValue;
69
+ } else {
70
+ const [item] = await this.dataSource.query(
71
+ `SELECT * FROM ${tableName} WHERE code = ? AND organization_id = ?`,
72
+ [codeValue, loggedInUser.organization_id],
73
+ );
74
+ resolvedEntityData[field] =
75
+ item?.[attr.data_source_attribute] ?? codeValue;
76
+ }
60
77
  }
61
78
  }
62
79