dynamo-bao 0.3.6 → 0.3.8
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 +1 -1
- package/src/mixins/mutation-mixin.js +12 -10
package/package.json
CHANGED
|
@@ -413,15 +413,17 @@ const MutationMethods = {
|
|
|
413
413
|
);
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
-
// Add new constraint
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
416
|
+
// Add new constraint unless value is null (clearing field removes constraint)
|
|
417
|
+
if (dyNewValue !== null) {
|
|
418
|
+
transactItems.push(
|
|
419
|
+
await this._createUniqueConstraint(
|
|
420
|
+
fieldName,
|
|
421
|
+
dyNewValue,
|
|
422
|
+
primaryId,
|
|
423
|
+
constraint.constraintId,
|
|
424
|
+
),
|
|
425
|
+
);
|
|
426
|
+
}
|
|
425
427
|
}
|
|
426
428
|
}
|
|
427
429
|
|
|
@@ -526,7 +528,7 @@ const MutationMethods = {
|
|
|
526
528
|
logger.debug("primaryId to load", primaryId);
|
|
527
529
|
|
|
528
530
|
// Fetch the item since transactWrite doesn't return values
|
|
529
|
-
|
|
531
|
+
let savedItem = await this.find(primaryId, { batchDelay: 0 });
|
|
530
532
|
|
|
531
533
|
// if the item doesn't exist, sleep for 200ms and try again
|
|
532
534
|
if (!savedItem.exists()) {
|