From ac930359999b2fba24d185b894c3a3635e9509c8 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 31 Oct 2023 00:35:10 +0530 Subject: [PATCH] fix: avoid duplicate api call in form view Signed-off-by: Pranav C --- packages/nc-gui/components/smartsheet/Form.vue | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Form.vue b/packages/nc-gui/components/smartsheet/Form.vue index 670b7c5c9e..fd8de40185 100644 --- a/packages/nc-gui/components/smartsheet/Form.vue +++ b/packages/nc-gui/components/smartsheet/Form.vue @@ -67,7 +67,7 @@ reloadEventHook.on(async () => { const { showAll, hideAll, saveOrUpdate } = useViewColumnsOrThrow() -const { syncLTARRefs, row } = useProvideSmartsheetRowStore( +const { state, row } = useProvideSmartsheetRowStore( meta, ref({ row: formState, @@ -124,11 +124,7 @@ async function submitForm() { if (e.errorFields.length) return } - const insertedRowData = await insertRow({ row: formState, oldRow: {}, rowMeta: { new: true } }) - - if (insertedRowData) { - await syncLTARRefs(insertedRowData) - } + await insertRow({ row: { ...formState, ...state.value }, oldRow: {}, rowMeta: { new: true } }) submitted.value = true }