From 0942d8d107e83436a7a7d68fcbe46b27e2e55bed Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 7 Nov 2022 14:39:42 +0530 Subject: [PATCH] refactor(gui): handle missing property scenario in a better way Signed-off-by: Pranav C --- packages/nc-gui/composables/useViewData.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nc-gui/composables/useViewData.ts b/packages/nc-gui/composables/useViewData.ts index 86eb3bc6c8..10e280f0fc 100644 --- a/packages/nc-gui/composables/useViewData.ts +++ b/packages/nc-gui/composables/useViewData.ts @@ -249,9 +249,6 @@ export function useViewData( ) { if (toUpdate.rowMeta) toUpdate.rowMeta.saving = true - // if the field name is missing return - if (!property) return - try { const id = extractPkFromRow(toUpdate.row, metaValue?.columns as ColumnType[]) @@ -310,7 +307,10 @@ export function useViewData( if (row.rowMeta.new) { return await insertRow(row, ltarState, args) } else { - await updateRowProperty(row, property!, args) + // if the field name is missing skip update + if (property) { + await updateRowProperty(row, property, args) + } } }