Enrich view with all schema

This commit is contained in:
Adria Navarro 2024-09-10 10:44:56 +02:00
parent 3ab39fb44c
commit dc9e1cbbc7
3 changed files with 8 additions and 11 deletions

View File

@ -193,8 +193,8 @@ export async function enrichSchema(
const isVisible = !!viewFieldSchema?.visible const isVisible = !!viewFieldSchema?.visible
const isReadonly = !!viewFieldSchema?.readonly const isReadonly = !!viewFieldSchema?.readonly
result[relTableFieldName] = { result[relTableFieldName] = {
...relTableField,
...viewFieldSchema, ...viewFieldSchema,
type: relTableField.type,
name: relTableField.name, name: relTableField.name,
visible: isVisible, visible: isVisible,
readonly: isReadonly, readonly: isReadonly,

View File

@ -10,6 +10,11 @@ export enum AutoReason {
FOREIGN_KEY = "foreign_key", FOREIGN_KEY = "foreign_key",
} }
export type FieldSubType =
| AutoFieldSubType
| JsonFieldSubType
| BBReferenceFieldSubType
export enum AutoFieldSubType { export enum AutoFieldSubType {
CREATED_BY = "createdBy", CREATED_BY = "createdBy",
CREATED_AT = "createdAt", CREATED_AT = "createdAt",

View File

@ -1,9 +1,4 @@
import { import { FieldSchema, RelationSchemaField, ViewV2 } from "../documents"
FieldSchema,
FieldType,
RelationSchemaField,
ViewV2,
} from "../documents"
export interface ViewV2Enriched extends ViewV2 { export interface ViewV2Enriched extends ViewV2 {
schema?: { schema?: {
@ -13,7 +8,4 @@ export interface ViewV2Enriched extends ViewV2 {
} }
} }
export interface ViewV2ColumnEnriched extends RelationSchemaField { export type ViewV2ColumnEnriched = RelationSchemaField & FieldSchema
name: string
type: FieldType
}