Browse Source

feat(nc-gui): pass params to fetchSharedViewData

pull/3818/head
Wing-Kam Wong 2 years ago
parent
commit
53482ba153
  1. 3
      packages/nc-gui/composables/useKanbanViewData.ts
  2. 6
      packages/nc-gui/composables/useSharedView.ts

3
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)]
}

6
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<Api<any>['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
}

Loading…
Cancel
Save