Browse Source

fix(nocodb): previous_rows & rows format

pull/5349/head
Wing-Kam Wong 2 years ago
parent
commit
cc3a9af228
  1. 5
      packages/nocodb/src/lib/meta/helpers/webhookHelpers.ts

5
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_id: view.id,
view_name: view.title, view_name: view.title,
...(prevData && { ...(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' && { ...(hook.operation === 'bulkInsert' && {
rows_inserted: Array.isArray(newData) rows_inserted: Array.isArray(newData)
? newData.length ? newData.length

Loading…
Cancel
Save