Browse Source

fix(nc-gui): view columns typing

pull/5269/head
Wing-Kam Wong 2 years ago
parent
commit
26a62666c6
  1. 6
      packages/nc-gui/composables/useViewColumns.ts

6
packages/nc-gui/composables/useViewColumns.ts

@ -35,13 +35,13 @@ export function useViewColumns(
const metaColumnById = computed<Record<string, ColumnType>>(() => { const metaColumnById = computed<Record<string, ColumnType>>(() => {
if (!meta.value?.columns) return {} if (!meta.value?.columns) return {}
return meta.value.columns.reduce( return (meta.value.columns as ColumnType[]).reduce(
(acc, curr) => ({ (acc, curr) => ({
...acc, ...acc,
[curr.id!]: curr, [curr.id!]: curr,
}), }),
{}, {},
) ) as Record<string, ColumnType>
}) })
const loadViewColumns = async () => { const loadViewColumns = async () => {
@ -162,7 +162,7 @@ export function useViewColumns(
const showSystemFields = computed({ const showSystemFields = computed({
get() { get() {
return view.value?.show_system_fields || false return (view.value?.show_system_fields as boolean) || false
}, },
set(v: boolean) { set(v: boolean) {
if (view?.value?.id) { if (view?.value?.id) {

Loading…
Cancel
Save