Browse Source

refactor(nc-gui): move formatData outside composable

pull/3563/head
Wing-Kam Wong 2 years ago
parent
commit
23620e817e
  1. 14
      packages/nc-gui/composables/useViewData.ts

14
packages/nc-gui/composables/useViewData.ts

@ -21,6 +21,13 @@ import {
} from '#imports'
import type { Row } from '~/lib'
const formatData = (list: Row[]) =>
list.map((row) => ({
row: { ...row },
oldRow: { ...row },
rowMeta: {},
}))
export function useViewData(
meta: Ref<TableType | undefined> | ComputedRef<TableType | undefined>,
viewMeta: Ref<ViewType | undefined> | ComputedRef<(ViewType & { id: string }) | undefined>,
@ -59,13 +66,6 @@ export function useViewData(
const { isUIAllowed } = useUIPermission()
const formatData = (list: Record<string, any>[]) =>
list.map((row) => ({
row: { ...row },
oldRow: { ...row },
rowMeta: {},
}))
const paginationData = computed({
get: () => (isPublic.value ? sharedPaginationData.value : _paginationData.value),
set: (value) => {

Loading…
Cancel
Save