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) }), ...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }),
where, where,
}) })
: // TODO: check this : await fetchSharedViewData(params)
await fetchSharedViewData()
formattedData.value[stackTitle] = [...formattedData.value[stackTitle], ...formatData(response.list)] 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 { UITypes } from 'nocodb-sdk'
import { useNuxtApp } from '#app' import { useNuxtApp } from '#app'
@ -53,7 +53,7 @@ export function useSharedView() {
Object.keys(relatedMetas).forEach((key) => setMeta(relatedMetas[key])) 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 if (!sharedView.value) return
const page = paginationData.value.page || 1 const page = paginationData.value.page || 1
@ -65,6 +65,7 @@ export function useSharedView() {
offset: (page - 1) * pageSize, offset: (page - 1) * pageSize,
filterArrJson: JSON.stringify(nestedFilters.value), filterArrJson: JSON.stringify(nestedFilters.value),
sortArrJson: JSON.stringify(sorts.value), sortArrJson: JSON.stringify(sorts.value),
...params,
} as any, } as any,
{ {
headers: { headers: {
@ -72,7 +73,6 @@ export function useSharedView() {
}, },
}, },
) )
return data return data
} }

Loading…
Cancel
Save