rez_core 4.0.76 → 4.0.78
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
|
@@ -344,20 +344,19 @@ export class EntityDynamicService {
|
|
|
344
344
|
);
|
|
345
345
|
} else {
|
|
346
346
|
// Delete the related entity if we are creating a new one
|
|
347
|
-
for (const existingRel of existingRelationsForType) {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
|
|
347
|
+
// for (const existingRel of existingRelationsForType) {
|
|
348
|
+
// await this.deleteEntity(
|
|
349
|
+
// existingRel.target_entity_type,
|
|
350
|
+
// existingRel.target_entity_id,
|
|
351
|
+
// loggedInUser,
|
|
352
|
+
// );
|
|
353
|
+
|
|
354
|
+
// // Delete the relation row
|
|
355
|
+
// await this.dataSource.query(
|
|
356
|
+
// `DELETE FROM frm_entity_relation_data WHERE id = ?`,
|
|
357
|
+
// [existingRel.id],
|
|
358
|
+
// );
|
|
359
|
+
// }
|
|
361
360
|
// Create new entity
|
|
362
361
|
const createdEntity = await this.createEntity(
|
|
363
362
|
targetEntityType,
|
|
@@ -371,22 +370,22 @@ export class EntityDynamicService {
|
|
|
371
370
|
targetEntityId,
|
|
372
371
|
loggedInUser,
|
|
373
372
|
);
|
|
374
|
-
}
|
|
375
373
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
374
|
+
// Insert relation as per new entity created
|
|
375
|
+
await this.dataSource.query(
|
|
376
|
+
`INSERT INTO frm_entity_relation_data
|
|
377
|
+
(organization_id, source_entity_id, source_entity_type, target_entity_id, target_entity_type, relation_type)
|
|
378
|
+
VALUES (?, ?, ?, ?, ?,?)`,
|
|
379
|
+
[
|
|
380
|
+
organizationId,
|
|
381
|
+
id,
|
|
382
|
+
entityType,
|
|
383
|
+
targetEntityId,
|
|
384
|
+
targetEntityType,
|
|
385
|
+
relationType,
|
|
386
|
+
],
|
|
387
|
+
);
|
|
388
|
+
}
|
|
390
389
|
|
|
391
390
|
if (relationType === 'ONE_TO_MANY') {
|
|
392
391
|
updatedEntities.push(entityData);
|