rez_core 5.0.129 → 5.0.131

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.129",
3
+ "version": "5.0.131",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -189,21 +189,13 @@ export class EntityListService {
189
189
  parentType: string | null,
190
190
  parentId: number | null,
191
191
  ) {
192
-
193
192
  const result = await repo
194
- .createQueryBuilder()
195
- .select("MAX(id)", "seq_no")
196
- .getRawOne();
197
-
198
- const seqNo = result?.seq_no ?? 0;
193
+ .createQueryBuilder()
194
+ .select('MAX(id)', 'seq_no')
195
+ .getRawOne();
199
196
 
200
- const argsObjectList: any[] = [];
201
- // if (parentId) {
202
- // query += ` AND parent_id = ? AND parent_type = ? `;
203
- // argsObjectList.push(parentId);
204
- // argsObjectList.push(parentType);
205
- // }
197
+ const seqNo = result?.seq_no ?? 0;
206
198
 
207
- return result ? result[0].seq_no : 0;
199
+ return seqNo;
208
200
  }
209
201
  }
@@ -100,13 +100,14 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
100
100
  // loggedInUser?.organization_id || 0,
101
101
  // );
102
102
 
103
- const statusList = await repo.query(
104
- `SELECT id
105
- FROM frm_list_master_items
106
- WHERE code = $1
107
- AND organization_id = $2`,
108
- [STATUS_ACTIVE, loggedInUser?.organization_id || 0],
109
- );
103
+ const listMasterItemsRepo = this.reflectionHelper.getRepoService('ListMasterItems');
104
+ const statusList = await listMasterItemsRepo.findOne({
105
+ where: {
106
+ code: STATUS_ACTIVE,
107
+ organization_id: loggedInUser?.organization_id || 0
108
+ },
109
+ select: ['id']
110
+ })
110
111
 
111
112
  console.log('Status List:', statusList); // Debug log
112
113
  console.log(
@@ -123,7 +124,7 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
123
124
  if (!entityData.level_type)
124
125
  entityData.level_type = loggedInUser.level_type;
125
126
  if (!entityData.level_id) entityData.level_id = loggedInUser.level_id;
126
- if (!entityData.status) entityData.status = statusList[0].id;
127
+ if (!entityData.status) entityData.status = statusList.id;
127
128
  }
128
129
 
129
130
  let savedData = repo.save(entityData);