From a33373f80b97bc8f40b2b75f353162f8f2219876 Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Mon, 30 Oct 2023 13:30:31 +0530 Subject: [PATCH] avniproject/avni-client#1142 - fixed the keys check --- src/framework/RealmProxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/framework/RealmProxy.js b/src/framework/RealmProxy.js index 26868bd..e2c6aa3 100644 --- a/src/framework/RealmProxy.js +++ b/src/framework/RealmProxy.js @@ -45,7 +45,7 @@ class RealmProxy { const emptyMandatoryProperties = []; const saveObjectKeys = Object.keys(underlyingObject); - if (updateMode === "never" || updateMode === false || _.intersection(mandatoryObjectSchemaProperties, saveObjectKeys.length > 0)) { + if (updateMode === "never" || updateMode === false || _.intersection(mandatoryObjectSchemaProperties, saveObjectKeys).length > 0) { saveObjectKeys.forEach((x) => { const propertyValue = underlyingObject[x]; if (_.isNil(propertyValue) && _.some(mandatoryObjectSchemaProperties, (y) => y === x)) emptyMandatoryProperties.push(x.propertyName);