diff --git a/packages/server/src/sdk/app/views/index.ts b/packages/server/src/sdk/app/views/index.ts index 13d81d6802..d7e05abf2f 100644 --- a/packages/server/src/sdk/app/views/index.ts +++ b/packages/server/src/sdk/app/views/index.ts @@ -193,8 +193,8 @@ export async function enrichSchema( const isVisible = !!viewFieldSchema?.visible const isReadonly = !!viewFieldSchema?.readonly result[relTableFieldName] = { + ...relTableField, ...viewFieldSchema, - type: relTableField.type, name: relTableField.name, visible: isVisible, readonly: isReadonly, diff --git a/packages/types/src/documents/app/table/constants.ts b/packages/types/src/documents/app/table/constants.ts index 210ad1423d..fffaddc5df 100644 --- a/packages/types/src/documents/app/table/constants.ts +++ b/packages/types/src/documents/app/table/constants.ts @@ -10,6 +10,11 @@ export enum AutoReason { FOREIGN_KEY = "foreign_key", } +export type FieldSubType = + | AutoFieldSubType + | JsonFieldSubType + | BBReferenceFieldSubType + export enum AutoFieldSubType { CREATED_BY = "createdBy", CREATED_AT = "createdAt", diff --git a/packages/types/src/sdk/view.ts b/packages/types/src/sdk/view.ts index 7480bf563f..422207197d 100644 --- a/packages/types/src/sdk/view.ts +++ b/packages/types/src/sdk/view.ts @@ -1,9 +1,4 @@ -import { - FieldSchema, - FieldType, - RelationSchemaField, - ViewV2, -} from "../documents" +import { FieldSchema, RelationSchemaField, ViewV2 } from "../documents" export interface ViewV2Enriched extends ViewV2 { schema?: { @@ -13,7 +8,4 @@ export interface ViewV2Enriched extends ViewV2 { } } -export interface ViewV2ColumnEnriched extends RelationSchemaField { - name: string - type: FieldType -} +export type ViewV2ColumnEnriched = RelationSchemaField & FieldSchema