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 isReadonly = !!viewFieldSchema?.readonly
result[relTableFieldName] = {
...relTableField,
...viewFieldSchema,
type: relTableField.type,
name: relTableField.name,
visible: isVisible,
readonly: isReadonly,

View File

@ -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",

View File

@ -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