Fixes fixes

This commit is contained in:
Adria Navarro 2023-10-06 09:32:28 +02:00
parent 1f1ebc82e5
commit a8c814e714
3 changed files with 13 additions and 7 deletions

View File

@ -1,5 +1,11 @@
import _ from "lodash"
import { FieldType, Table, TableSchema, ViewV2 } from "@budibase/types"
import {
FieldSchema,
FieldType,
Table,
TableSchema,
ViewV2,
} from "@budibase/types"
import { generator } from "@budibase/backend-core/tests"
import { enrichSchema, syncSchema } from ".."
@ -316,7 +322,7 @@ describe("table sdk", () => {
...basicView,
}
const newTableSchema = {
const newTableSchema: TableSchema = {
...basicTable.schema,
newField1: {
type: FieldType.STRING,
@ -403,7 +409,7 @@ describe("table sdk", () => {
},
}
const newTableSchema = {
const newTableSchema: TableSchema = {
...basicTable.schema,
newField1: {
type: FieldType.STRING,
@ -531,7 +537,7 @@ describe("table sdk", () => {
id: {
...basicTable.schema.id,
type: FieldType.NUMBER,
},
} as FieldSchema,
},
undefined
)

View File

@ -5,13 +5,13 @@ import {
FormulaTypes,
} from "../../constants"
import { processStringSync } from "@budibase/string-templates"
import { AutoColumnFieldMetadata, Row, Table } from "@budibase/types"
import { FieldSchema, Row, Table } from "@budibase/types"
/**
* If the subtype has been lost for any reason this works out what
* subtype the auto column should be.
*/
export function fixAutoColumnSubType(column: AutoColumnFieldMetadata) {
export function fixAutoColumnSubType(column: FieldSchema) {
if (!column.autocolumn || !column.name || column.subtype) {
return column
}

View File

@ -121,7 +121,7 @@ interface BaseFieldSchema extends UIFieldMetadata {
subtype?: string
}
export interface OtherFieldMetadata extends BaseFieldSchema {
interface OtherFieldMetadata extends BaseFieldSchema {
type: Exclude<
FieldType,
| FieldType.DATETIME