Browse Source

refactor(nc-gui): move update logic to updateKanbanMeta

pull/3818/head
Wing-Kam Wong 2 years ago
parent
commit
2a6bc76cca
  1. 9
      packages/nc-gui/components/smartsheet-toolbar/StackedBy.vue

9
packages/nc-gui/components/smartsheet-toolbar/StackedBy.vue

@ -47,7 +47,10 @@ const {
metaColumnById, metaColumnById,
} = useViewColumns(activeView, meta, () => reloadDataHook.trigger()) } = useViewColumns(activeView, meta, () => reloadDataHook.trigger())
const { kanbanMetaData, loadKanbanMeta, loadKanbanData, groupingField } = useKanbanViewData(meta, activeView as any) const { kanbanMetaData, loadKanbanMeta, loadKanbanData, updateKanbanMeta, groupingField } = useKanbanViewData(
meta,
activeView as any,
)
watch( watch(
() => (activeView.value as any)?.id, () => (activeView.value as any)?.id,
@ -68,12 +71,10 @@ const groupingFieldColumnId = computed({
get: () => kanbanMetaData?.value?.grp_column_id, get: () => kanbanMetaData?.value?.grp_column_id,
set: async (val) => { set: async (val) => {
if (val) { if (val) {
await $api.dbView.kanbanUpdate(activeView.value.id, { await updateKanbanMeta({
...kanbanMetaData.value,
grp_column_id: val, grp_column_id: val,
}) })
;(activeView.value?.view as KanbanType).grp_column_id = val ;(activeView.value?.view as KanbanType).grp_column_id = val
await loadKanbanMeta()
} }
}, },
}) })

Loading…
Cancel
Save