From 48b254b49c88d694e310821ad6e780aaa7f85f7d Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 10 Mar 2023 16:37:49 +0800 Subject: [PATCH] fix(nc-gui): map view typing --- packages/nc-gui/composables/useMapViewDataStore.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/composables/useMapViewDataStore.ts b/packages/nc-gui/composables/useMapViewDataStore.ts index 1ac4a6ecba..acb980bbe1 100644 --- a/packages/nc-gui/composables/useMapViewDataStore.ts +++ b/packages/nc-gui/composables/useMapViewDataStore.ts @@ -23,7 +23,7 @@ const formatData = (list: Record[]) => const [useProvideMapViewStore, useMapViewStore] = useInjectionState( ( meta: Ref, - viewMeta: Ref | ComputedRef<(ViewType & { id: string }) | undefined>, + viewMeta: Ref<(ViewType | MapType | undefined) & { id: string }> | ComputedRef<(ViewType & { id: string }) | undefined>, shared = false, where?: ComputedRef, ) => { @@ -88,7 +88,7 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState( }) : await fetchSharedViewData({ sortsArr: sorts.value, filtersArr: nestedFilters.value }) - formattedData.value = formatData(res.list) + formattedData.value = formatData(res!.list) } async function updateMapMeta(updateObj: Partial) { @@ -107,7 +107,7 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState( { metaValue = meta.value, viewMetaValue = viewMeta.value, - }: { metaValue?: MapType; viewMetaValue?: ViewType | MapType } = {}, + }: { metaValue?: MapType & { id: string }; viewMetaValue?: (ViewType | MapType) & { id: string } } = {}, ) { const row = currentRow.row if (currentRow.rowMeta) currentRow.rowMeta.saving = true