rez_core 2.1.50 → 2.1.52

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.1.50",
3
+ "version": "2.1.52",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -462,8 +462,9 @@ export class FilterService {
462
462
  const op = filter.filter_operator;
463
463
  const key = `param_${attr}_${Math.random().toString(36).substring(2, 8)}`;
464
464
 
465
- if (meta.data_source_type === 'entity' && !filter.skip_id)
465
+ if (meta.data_source_type === 'entity' && !filter.skip_id) {
466
466
  attr = `${attr}_id`;
467
+ }
467
468
 
468
469
  switch (meta.data_type) {
469
470
  case 'text':
@@ -560,8 +561,16 @@ export class FilterService {
560
561
  if (typeof val === 'string') {
561
562
  val = val.split(',').map((v) => v.trim());
562
563
  }
563
- if (!Array.isArray(val) || val.length !== 2) {
564
- throw new BadRequestException(`Invalid value for in_between: ${val}`);
564
+
565
+ if (
566
+ !Array.isArray(val) ||
567
+ val.length !== 2 ||
568
+ val[0] === '' ||
569
+ val[1] === ''
570
+ ) {
571
+ // throw new BadRequestException(`Invalid value for in_between: ${val}`);
572
+ console.log(`Invalid value for in_between: ${val}`);
573
+ return null;
565
574
  }
566
575
  return {
567
576
  query: `e.${attr} BETWEEN :${key}_start AND :${key}_end`,
@@ -141,6 +141,11 @@ export class SavedFilterService extends EntityServiceImpl {
141
141
  await this.savedFilterRepo.deleteDetailsByCode(entityData.code);
142
142
 
143
143
  await repoService.delete(entityId);
144
+
145
+ return {
146
+ success: true,
147
+ message: `Entity with id ${entityId} deleted successfully.`,
148
+ };
144
149
  }
145
150
 
146
151
  async getDetailsByCode(code: string): Promise<SavedFilterDetail[]> {
@@ -178,11 +178,7 @@ export class EntityController {
178
178
  throw new NotFoundException(`No entity found for id "${id}"`);
179
179
  }
180
180
 
181
- await entityService.deleteEntity(entityType, id);
182
-
183
- return {
184
- success: true,
185
- };
181
+ return await entityService.deleteEntity(entityType, id);
186
182
  }
187
183
 
188
184
  @Post('getFilteredDataWithTabs/:entity_type')
@@ -114,6 +114,11 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
114
114
  }
115
115
 
116
116
  await repoService.delete(entityId);
117
+
118
+ return {
119
+ success: true,
120
+ message: `Entity with id ${entityId} deleted successfully.`,
121
+ };
117
122
  }
118
123
 
119
124
  async findByCode(entityType: string, code: string): Promise<BaseEntity> {