rez_core 3.1.9 → 3.1.11

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": "3.1.9",
3
+ "version": "3.1.11",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -105,7 +105,7 @@ export class FilterService {
105
105
  for (const [subEntityType, filters] of Object.entries(grouped)) {
106
106
  if (subEntityType === entity_type) continue; // skip main entity for now
107
107
 
108
- let { queryParams, ...newDto } = dto;
108
+ let { queryParams,tabs, ...newDto } = dto;
109
109
 
110
110
  const subDto: FilterRequestDto = {
111
111
  ...newDto,
@@ -26,7 +26,6 @@ export class TaskService extends EntityServiceImpl {
26
26
  name: string = 'add_task';
27
27
 
28
28
  async execute(payload: any): Promise<any> {
29
- console.log('BHUSHAN');
30
29
  const { entity, user, config } = payload;
31
30
 
32
31
  let toValue: string | null = null;
@@ -76,7 +75,7 @@ export class TaskService extends EntityServiceImpl {
76
75
  if (entityData && typeof entityData['is_mandatory'] === 'string') {
77
76
  entityData['is_mandatory'] = entityData['is_mandatory'] === '1';
78
77
  }
79
- const result = await super.createEntity(
78
+ const createdEntity = await super.createEntity(
80
79
  entityData,
81
80
  loggedInUser,
82
81
  manager,
@@ -85,10 +84,10 @@ export class TaskService extends EntityServiceImpl {
85
84
 
86
85
  try {
87
86
  const logData = {
88
- mapped_entity_id: result.mapped_entity_id,
89
- mapped_entity_type: result.mapped_entity_type,
87
+ mapped_entity_id: createdEntity.mapped_entity_id,
88
+ mapped_entity_type: createdEntity.mapped_entity_type,
90
89
  title: `Task added`,
91
- description: `A new task ${result.name} was added`,
90
+ description: `A new task ${createdEntity.name} was added`,
92
91
  category: ACTIVITY_CATEGORIES.TASK,
93
92
  action: 'add',
94
93
  appcode: loggedInUser.appcode,
@@ -102,7 +101,26 @@ export class TaskService extends EntityServiceImpl {
102
101
  );
103
102
  // Logging should not block main flow
104
103
  }
105
- return result;
104
+
105
+ let relationData = await this.dataSource.query(
106
+ `SELECT * FROM cr_entity_relation WHERE source_entity_type = ? AND target_entity_type = ?`,
107
+ [createdEntity.mapped_entity_type, createdEntity.entity_type],
108
+ );
109
+
110
+ if (relationData) {
111
+ await this.dataSource.query(
112
+ `INSERT INTO cr_entity_relation_data (source_entity_id, source_entity_type, target_entity_id, target_entity_type, relation_type) VALUES (?, ?, ?, ?, ?)`,
113
+ [
114
+ createdEntity.mapped_entity_id,
115
+ createdEntity.mapped_entity_type,
116
+ createdEntity.id,
117
+ createdEntity.entity_type,
118
+ relationData[0]?.relation_type,
119
+ ],
120
+ );
121
+ }
122
+
123
+ return createdEntity;
106
124
  }
107
125
 
108
126
  async updateEntity(