rez_core 4.0.75 → 4.0.76

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.75",
3
+ "version": "4.0.76",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -320,21 +320,6 @@ export class EntityDynamicService {
320
320
  [entityType, id, targetEntityType],
321
321
  );
322
322
 
323
- for (const existingRel of existingRelationsForType) {
324
- // Delete the related entity
325
- await this.deleteEntity(
326
- existingRel.target_entity_type,
327
- existingRel.target_entity_id,
328
- loggedInUser,
329
- );
330
-
331
- // Delete the relation row
332
- await this.dataSource.query(
333
- `DELETE FROM frm_entity_relation_data WHERE id = ?`,
334
- [existingRel.id],
335
- );
336
- }
337
-
338
323
  // Create/update new entities & relations
339
324
  const updatedEntities: any[] = [];
340
325
 
@@ -358,6 +343,21 @@ export class EntityDynamicService {
358
343
  loggedInUser,
359
344
  );
360
345
  } else {
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
+
361
361
  // Create new entity
362
362
  const createdEntity = await this.createEntity(
363
363
  targetEntityType,