From cc3a9af228b159fb622087f7c5d7382212efb2a5 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 31 Mar 2023 00:27:46 +0800 Subject: [PATCH] fix(nocodb): previous_rows & rows format --- packages/nocodb/src/lib/meta/helpers/webhookHelpers.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/lib/meta/helpers/webhookHelpers.ts b/packages/nocodb/src/lib/meta/helpers/webhookHelpers.ts index 574a517179..0989089186 100644 --- a/packages/nocodb/src/lib/meta/helpers/webhookHelpers.ts +++ b/packages/nocodb/src/lib/meta/helpers/webhookHelpers.ts @@ -149,9 +149,10 @@ export function constructWebHookData(hook, model, view, prevData, newData) { view_id: view.id, view_name: view.title, ...(prevData && { - previous_rows: [prevData], + previous_rows: Array.isArray(prevData) ? prevData : [prevData], }), - ...(hook.operation !== 'bulkInsert' && newData && { rows: [newData] }), + ...(hook.operation !== 'bulkInsert' && + newData && { rows: Array.isArray(newData) ? newData : [newData] }), ...(hook.operation === 'bulkInsert' && { rows_inserted: Array.isArray(newData) ? newData.length