Browse Source

refactor(gui): handle missing property scenario in a better way

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4295/head
Pranav C 2 years ago
parent
commit
0942d8d107
  1. 8
      packages/nc-gui/composables/useViewData.ts

8
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)
}
}
}

Loading…
Cancel
Save