From 53482ba153ac1f2a16919a02d9e07dab9523e6b9 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 23 Sep 2022 12:32:23 +0800 Subject: [PATCH] feat(nc-gui): pass params to fetchSharedViewData --- packages/nc-gui/composables/useKanbanViewData.ts | 3 +-- packages/nc-gui/composables/useSharedView.ts | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/nc-gui/composables/useKanbanViewData.ts b/packages/nc-gui/composables/useKanbanViewData.ts index 81a8283063..2fda89ed0b 100644 --- a/packages/nc-gui/composables/useKanbanViewData.ts +++ b/packages/nc-gui/composables/useKanbanViewData.ts @@ -112,8 +112,7 @@ export function useKanbanViewData( ...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }), where, }) - : // TODO: check this - await fetchSharedViewData() + : await fetchSharedViewData(params) formattedData.value[stackTitle] = [...formattedData.value[stackTitle], ...formatData(response.list)] } diff --git a/packages/nc-gui/composables/useSharedView.ts b/packages/nc-gui/composables/useSharedView.ts index 336aa3ea65..14127b55fe 100644 --- a/packages/nc-gui/composables/useSharedView.ts +++ b/packages/nc-gui/composables/useSharedView.ts @@ -1,4 +1,4 @@ -import type { ExportTypes, FilterType, PaginatedType, RequestParams, SortType, TableType, ViewType } from 'nocodb-sdk' +import type { Api, ExportTypes, FilterType, PaginatedType, RequestParams, SortType, TableType, ViewType } from 'nocodb-sdk' import { UITypes } from 'nocodb-sdk' import { useNuxtApp } from '#app' @@ -53,7 +53,7 @@ export function useSharedView() { Object.keys(relatedMetas).forEach((key) => setMeta(relatedMetas[key])) } - const fetchSharedViewData = async () => { + const fetchSharedViewData = async (params: Parameters['dbViewRow']['list']>[4] = {}) => { if (!sharedView.value) return const page = paginationData.value.page || 1 @@ -65,6 +65,7 @@ export function useSharedView() { offset: (page - 1) * pageSize, filterArrJson: JSON.stringify(nestedFilters.value), sortArrJson: JSON.stringify(sorts.value), + ...params, } as any, { headers: { @@ -72,7 +73,6 @@ export function useSharedView() { }, }, ) - return data }