Browse Source

fix(nc-gui): type issues

pull/4959/head
Wing-Kam Wong 2 years ago
parent
commit
9e26b57e2c
  1. 4
      packages/nc-gui/composables/useKanbanViewStore.ts
  2. 5
      packages/nc-gui/composables/useSmartsheetStore.ts
  3. 2
      packages/nc-gui/composables/useViewData.ts

4
packages/nc-gui/composables/useKanbanViewStore.ts

@ -71,7 +71,9 @@ const [useProvideKanbanViewStore, useKanbanViewStore] = useInjectionState(
const { sqlUis } = useProject()
const sqlUi = ref(meta.value?.base_id ? sqlUis.value[meta.value?.base_id] : Object.values(sqlUis.value)[0])
const sqlUi = ref(
(meta.value as TableType)?.base_id ? sqlUis.value[(meta.value as TableType)?.base_id!] : Object.values(sqlUis.value)[0],
)
const xWhere = computed(() => {
let where

5
packages/nc-gui/composables/useSmartsheetStore.ts

@ -13,9 +13,12 @@ const [useProvideSmartsheetStore, useSmartsheetStore] = useInjectionState(
initialFilters?: Ref<FilterType[]>,
) => {
const { $api } = useNuxtApp()
const { sqlUis } = useProject()
const sqlUi = ref(meta.value?.base_id ? sqlUis.value[meta.value?.base_id] : Object.values(sqlUis.value)[0])
const sqlUi = ref(
(meta.value as TableType)?.base_id ? sqlUis.value[(meta.value as TableType)?.base_id!] : Object.values(sqlUis.value)[0],
)
const cellRefs = ref<HTMLTableDataCellElement[]>([])

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

@ -511,7 +511,7 @@ export function useViewData(
order: (fieldById[c.id] && fieldById[c.id].order) || order++,
id: fieldById[c.id] && fieldById[c.id].id,
}))
.sort((a: Record<string, any>, b: Record<string, any>) => a.order - b.order) as Record<string, any>
.sort((a: Record<string, any>, b: Record<string, any>) => a.order - b.order) as Record<string, any>[]
} catch (e: any) {
return message.error(`${t('msg.error.setFormDataFailed')}: ${await extractSdkResponseErrorMsg(e)}`)
}

Loading…
Cancel
Save