Browse Source

chore(gui-v2): fix types of formstate in useColumnCreateStore

pull/3044/head
braks 2 years ago
parent
commit
7e99ad9385
  1. 6
      packages/nc-gui-v2/components/smartsheet-column/AdvancedOptions.vue
  2. 2
      packages/nc-gui-v2/composables/useColumnCreateStore.ts

6
packages/nc-gui-v2/components/smartsheet-column/AdvancedOptions.vue

@ -1,9 +1,11 @@
<script setup lang="ts">
import type { UITypes } from 'nocodb-sdk'
import { useColumnCreateStoreOrThrow } from '#imports'
const { formState, validateInfos, setAdditionalValidations, sqlUi, onDataTypeChange, onAlter } = useColumnCreateStoreOrThrow()
const { formState, validateInfos, sqlUi, onDataTypeChange, onAlter } = useColumnCreateStoreOrThrow()
const dataTypes = computed(() => sqlUi?.value?.getDataTypeListForUiType(formState))
// todo: 2nd argument of `getDataTypeListForUiType` is missing!
const dataTypes = computed(() => sqlUi?.value?.getDataTypeListForUiType(formState.value as { uidt: UITypes }, '' as any))
// to avoid type error with checkbox
formState.value.rqd = !!formState.value.rqd

2
packages/nc-gui-v2/composables/useColumnCreateStore.ts

@ -31,7 +31,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState
// state
// todo: give proper type - ColumnType
const formState = ref<Partial<Record<string, any>>>({
const formState = ref<Record<string, any>>({
title: 'title',
uidt: UITypes.SingleLineText,
...(column?.value || {}),

Loading…
Cancel
Save