rez_core 2.1.49 → 2.1.51
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/dist/module/filter/service/saved-filter.service.d.ts +4 -1
- package/dist/module/filter/service/saved-filter.service.js +15 -4
- package/dist/module/filter/service/saved-filter.service.js.map +1 -1
- package/dist/module/meta/controller/entity.controller.d.ts +1 -0
- package/dist/module/meta/controller/entity.controller.js +1 -4
- package/dist/module/meta/controller/entity.controller.js.map +1 -1
- package/dist/module/meta/service/entity-service-impl.service.d.ts +4 -1
- package/dist/module/meta/service/entity-service-impl.service.js +4 -0
- package/dist/module/meta/service/entity-service-impl.service.js.map +1 -1
- package/dist/module/user/entity/user.entity.d.ts +1 -0
- package/dist/module/user/entity/user.entity.js +4 -0
- package/dist/module/user/entity/user.entity.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/filter/service/saved-filter.service.ts +18 -5
- package/src/module/meta/controller/entity.controller.ts +1 -5
- package/src/module/meta/service/entity-service-impl.service.ts +5 -0
- package/src/module/user/entity/user.entity.ts +3 -0
package/package.json
CHANGED
|
@@ -79,6 +79,7 @@ export class SavedFilterService extends EntityServiceImpl {
|
|
|
79
79
|
ENTITYTYPE_SAVEDFILTERMASTER,
|
|
80
80
|
master.id,
|
|
81
81
|
);
|
|
82
|
+
|
|
82
83
|
if (!existing) {
|
|
83
84
|
throw new BadRequestException('Saved filter not found.');
|
|
84
85
|
}
|
|
@@ -87,7 +88,7 @@ export class SavedFilterService extends EntityServiceImpl {
|
|
|
87
88
|
name: master.name,
|
|
88
89
|
organization_id: master.organization_id,
|
|
89
90
|
enterprise_id: master.enterprise_id,
|
|
90
|
-
id: master.id, // Include ID to check
|
|
91
|
+
id: master.id, // Include ID to allow same-name check during update
|
|
91
92
|
});
|
|
92
93
|
|
|
93
94
|
if (nameExists) {
|
|
@@ -100,10 +101,17 @@ export class SavedFilterService extends EntityServiceImpl {
|
|
|
100
101
|
if (filterDetails?.length) {
|
|
101
102
|
await this.savedFilterRepo.deleteDetailsByCode(updated.code);
|
|
102
103
|
|
|
103
|
-
const prepared = filterDetails.map((detail: any) =>
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
const prepared = filterDetails.map((detail: any) => {
|
|
105
|
+
const isMultiSelect = Array.isArray(detail.filter_value);
|
|
106
|
+
return {
|
|
107
|
+
...detail,
|
|
108
|
+
mapped_filter_code: updated.code,
|
|
109
|
+
filter_value: isMultiSelect
|
|
110
|
+
? detail.filter_value.join(',')
|
|
111
|
+
: detail.filter_value,
|
|
112
|
+
data_type: isMultiSelect ? 'multiselect' : detail.data_type,
|
|
113
|
+
};
|
|
114
|
+
});
|
|
107
115
|
|
|
108
116
|
await this.savedFilterRepo.saveDetails(prepared);
|
|
109
117
|
}
|
|
@@ -133,6 +141,11 @@ export class SavedFilterService extends EntityServiceImpl {
|
|
|
133
141
|
await this.savedFilterRepo.deleteDetailsByCode(entityData.code);
|
|
134
142
|
|
|
135
143
|
await repoService.delete(entityId);
|
|
144
|
+
|
|
145
|
+
return {
|
|
146
|
+
success: true,
|
|
147
|
+
message: `Entity with id ${entityId} deleted successfully.`,
|
|
148
|
+
};
|
|
136
149
|
}
|
|
137
150
|
|
|
138
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> {
|