Files

16 lines
566 B
TypeScript

import { belongsTo } from '@adonisjs/lucid/orm'
import type { BelongsTo } from '@adonisjs/lucid/types/relations'
import WebPage from '#base_modules/WebManager/model/web_page'
import type { BlockData, BlockType } from '#base_modules/WebManager/types/web_content'
import { WebComponentSchema } from '#database/schema'
export default class WebComponent extends WebComponentSchema {
static table = 'web_components'
declare type: BlockType
declare data: BlockData
@belongsTo(() => WebPage, { foreignKey: 'pageId' })
declare page: BelongsTo<typeof WebPage>
}