You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if you use isMarkedForDestruction on multiple relationships, the result on the graphiti server is correct
but on the js side only half the relations seems destroyed.
here is the patch i used :
diff --git a/lib-esm/util/write-payload.js b/lib-esm/util/write-payload.js
index 0842980665b01656699b055519c4fa466eb657d1..94f29123cfec88eb5e9911d52c7b3a759eeee4b3 100644
--- a/lib-esm/util/write-payload.js
+++ b/lib-esm/util/write-payload.js
@@ -38,7 +38,7 @@ var WritePayload = /** @class */ (function () {
var relatedObjects = modelIdx[key];
if (relatedObjects) {
if (Array.isArray(relatedObjects)) {
- relatedObjects.forEach(function (relatedObject, index) {
+ relatedObjects.slice().reduceRight(function(_,relatedObject,index) {
if (relatedObject.isMarkedForDestruction ||
relatedObject.isMarkedForDisassociation) {
modelIdx[key].splice(index, 1);
@@ -46,7 +46,7 @@ var WritePayload = /** @class */ (function () {
else {
_this.removeDeletions(relatedObject, nested);
}
- });
+ },null);
}
else {
var relatedObject = relatedObjects;
index gets wrong when some elements are destroy. So the fix reads the array from right to left.
The text was updated successfully, but these errors were encountered:
if you use isMarkedForDestruction on multiple relationships, the result on the graphiti server is correct
but on the js side only half the relations seems destroyed.
here is the patch i used :
index gets wrong when some elements are destroy. So the fix reads the array from right to left.
The text was updated successfully, but these errors were encountered: