Browse Source

refactor(nc-gui): pass update object only

pull/5269/head
Wing-Kam Wong 2 years ago
parent
commit
59731bb7e4
  1. 2
      packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
  2. 5
      packages/nc-gui/composables/useKanbanViewStore.ts

2
packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

@ -125,13 +125,11 @@ const coverImageColumnId = computed({
) {
if (activeView.value?.type === ViewTypes.GALLERY) {
await $api.dbView.galleryUpdate(activeView.value?.id, {
...activeView.value?.view,
fk_cover_image_col_id: val,
})
;(activeView.value.view as GalleryType).fk_cover_image_col_id = val
} else if (activeView.value?.type === ViewTypes.KANBAN) {
await $api.dbView.kanbanUpdate(activeView.value?.id, {
...activeView.value?.view,
fk_cover_image_col_id: val,
})
;(activeView.value.view as KanbanType).fk_cover_image_col_id = val

5
packages/nc-gui/composables/useKanbanViewStore.ts

@ -300,10 +300,7 @@ const [useProvideKanbanViewStore, useKanbanViewStore] = useInjectionState(
async function updateKanbanMeta(updateObj: Partial<KanbanType>) {
if (!viewMeta?.value?.id || !isUIAllowed('xcDatatableEditable')) return
await $api.dbView.kanbanUpdate(viewMeta.value.id, {
...kanbanMetaData.value,
...updateObj,
})
await $api.dbView.kanbanUpdate(viewMeta.value.id, updateObj)
}
async function insertRow(row: Record<string, any>, rowIndex = formattedData.value.get(null)!.length) {

Loading…
Cancel
Save