From 12fe55a7f0873c24a69873f9491d725ca9cece33 Mon Sep 17 00:00:00 2001 From: Shumpei Kishi Date: Mon, 3 Oct 2022 15:09:43 +0900 Subject: [PATCH 1/2] Fixing the validation logic to accept boolean false value. --- packages/server/src/automations/steps/updateRow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/automations/steps/updateRow.js b/packages/server/src/automations/steps/updateRow.js index f66fcf9432..275095c98f 100644 --- a/packages/server/src/automations/steps/updateRow.js +++ b/packages/server/src/automations/steps/updateRow.js @@ -66,9 +66,9 @@ exports.run = async function ({ inputs, appId, emitter }) { } const tableId = inputs.row.tableId - // clear any falsy properties so that they aren't updated + // clear any null or empty string properties so that they aren't updated for (let propKey of Object.keys(inputs.row)) { - if (!inputs.row[propKey] || inputs.row[propKey] === "") { + if (inputs.row[propKey] === null || inputs.row[propKey] === "") { delete inputs.row[propKey] } } From fb0a1468f7019d2287dcdd50436249ca125032c6 Mon Sep 17 00:00:00 2001 From: Shumpei Kishi Date: Mon, 3 Oct 2022 17:34:06 +0900 Subject: [PATCH 2/2] Adding a validation check for undefined --- packages/server/src/automations/steps/updateRow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/automations/steps/updateRow.js b/packages/server/src/automations/steps/updateRow.js index 275095c98f..5a2c158c5f 100644 --- a/packages/server/src/automations/steps/updateRow.js +++ b/packages/server/src/automations/steps/updateRow.js @@ -66,9 +66,9 @@ exports.run = async function ({ inputs, appId, emitter }) { } const tableId = inputs.row.tableId - // clear any null or empty string properties so that they aren't updated + // clear any undefined, null or empty string properties so that they aren't updated for (let propKey of Object.keys(inputs.row)) { - if (inputs.row[propKey] === null || inputs.row[propKey] === "") { + if (inputs.row[propKey] == null || inputs.row[propKey] === "") { delete inputs.row[propKey] } }