From f0cb3260ca54b082535015ba1f069df91f552c79 Mon Sep 17 00:00:00 2001 From: mertmit Date: Thu, 18 Apr 2024 11:33:17 +0000 Subject: [PATCH] fix: upsert detection --- packages/nc-gui/composables/useExtensionHelper.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/composables/useExtensionHelper.ts b/packages/nc-gui/composables/useExtensionHelper.ts index 945a0d8c3a..fb211c3c03 100644 --- a/packages/nc-gui/composables/useExtensionHelper.ts +++ b/packages/nc-gui/composables/useExtensionHelper.ts @@ -151,17 +151,19 @@ const [useProvideExtensionHelper, useExtensionHelper] = useInjectionState((exten insert.push( ...chunk.filter( (record: Record) => - !list.some((r: Record) => r[upsertField.title!] === record[upsertField.title!]), + !list.some((r: Record) => `${r[upsertField.title!]}` === `${record[upsertField.title!]}`), ), ) update.push( ...chunk .filter((record: Record) => - list.some((r: Record) => r[upsertField.title!] === record[upsertField.title!]), + list.some((r: Record) => `${r[upsertField.title!]}` === `${record[upsertField.title!]}`), ) .map((record: Record) => { - const existingRecord = list.find((r: Record) => r[upsertField.title!] === record[upsertField.title!]) + const existingRecord = list.find( + (r: Record) => `${r[upsertField.title!]}` === `${record[upsertField.title!]}`, + ) return { ...rowPkData(existingRecord!, tableMeta.columns!), ...record,