diff --git a/packages/nc-gui/composables/useViewData.ts b/packages/nc-gui/composables/useViewData.ts index 05b86d81e8..82ac9e3cf5 100644 --- a/packages/nc-gui/composables/useViewData.ts +++ b/packages/nc-gui/composables/useViewData.ts @@ -1,4 +1,4 @@ -import type { Api, ColumnType, FormType, GalleryType, PaginatedType, TableType, ViewType } from 'nocodb-sdk' +import type { Api, ColumnType, FormType, GalleryType, KanbanType, PaginatedType, TableType, ViewType } from 'nocodb-sdk' import type { ComputedRef, Ref } from 'vue' import { message } from 'ant-design-vue' import { useI18n } from 'vue-i18n' @@ -45,6 +45,7 @@ export function useViewData( const _paginationData = ref({ page: 1, pageSize: 25 }) const aggCommentCount = ref<{ row_id: string; count: number }[]>([]) const galleryData = ref() + const kanbanData = ref() const formColumnData = ref() // todo: missing properties on FormType (success_msg, show_blank_form, const formViewData = ref() @@ -182,6 +183,11 @@ export function useViewData( galleryData.value = await $api.dbView.galleryRead(viewMeta.value.id) } + async function loadKanbanData() { + if (!viewMeta?.value?.id) return + galleryData.value = await $api.dbView.kanbanRead(viewMeta.value.id) + } + async function insertRow(row: Record, rowIndex = formattedData.value?.length) { try { const insertObj = meta?.value?.columns?.reduce((o: any, col) => { @@ -408,5 +414,6 @@ export function useViewData( aggCommentCount, loadAggCommentsCount, removeLastEmptyRow, + loadKanbanData, } }