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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "4.0.76",
3
+ "version": "4.0.78",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -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
- 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
- }
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
- // Insert relation
377
- await this.dataSource.query(
378
- `INSERT INTO frm_entity_relation_data
379
- (organization_id, source_entity_id, source_entity_type, target_entity_id, target_entity_type, relation_type)
380
- VALUES (?, ?, ?, ?, ?,?)`,
381
- [
382
- organizationId,
383
- id,
384
- entityType,
385
- targetEntityId,
386
- targetEntityType,
387
- relationType,
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);