Browse Source

code cleanup

pull/5248/head
Daniel Spaude 2 years ago
parent
commit
2c40e2ad58
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 2
      packages/nc-gui/composables/useMapViewDataStore.ts
  2. 7
      packages/nc-gui/composables/useSharedView.ts

2
packages/nc-gui/composables/useMapViewDataStore.ts

@ -47,7 +47,7 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState(
const { sorts, nestedFilters } = useSmartsheetStoreOrThrow() const { sorts, nestedFilters } = useSmartsheetStoreOrThrow()
const { sharedView, fetchSharedViewData } = useSharedView(defaultPageSize) const { sharedView, fetchSharedViewData } = useSharedView()
const mapMetaData = ref<MapType>({}) const mapMetaData = ref<MapType>({})

7
packages/nc-gui/composables/useSharedView.ts

@ -1,4 +1,4 @@
import type { import {
ExportTypes, ExportTypes,
FilterType, FilterType,
KanbanType, KanbanType,
@ -8,11 +8,12 @@ import type {
SortType, SortType,
TableType, TableType,
ViewType, ViewType,
ViewTypes,
} from 'nocodb-sdk' } from 'nocodb-sdk'
import { UITypes } from 'nocodb-sdk' import { UITypes } from 'nocodb-sdk'
import { computed, storeToRefs, useGlobal, useMetas, useNuxtApp, useState } from '#imports' import { computed, storeToRefs, useGlobal, useMetas, useNuxtApp, useState } from '#imports'
export function useSharedView(limit?: number) { export function useSharedView() {
const nestedFilters = ref<(FilterType & { status?: 'update' | 'delete' | 'create'; parentId?: string })[]>([]) const nestedFilters = ref<(FilterType & { status?: 'update' | 'delete' | 'create'; parentId?: string })[]>([])
const { appInfo } = $(useGlobal()) const { appInfo } = $(useGlobal())
@ -121,7 +122,7 @@ export function useSharedView(limit?: number) {
return await $api.public.dataList( return await $api.public.dataList(
sharedView.value.uuid!, sharedView.value.uuid!,
{ {
limit, limit: sharedView.value?.type === ViewTypes.MAP ? 1000 : undefined,
...param, ...param,
filterArrJson: JSON.stringify(param.filtersArr ?? nestedFilters.value), filterArrJson: JSON.stringify(param.filtersArr ?? nestedFilters.value),
sortArrJson: JSON.stringify(param.sortsArr ?? sorts.value), sortArrJson: JSON.stringify(param.sortsArr ?? sorts.value),

Loading…
Cancel
Save