refactor: change page type

This commit is contained in:
Innei
2021-10-15 22:58:59 +08:00
parent 3f70923648
commit 3e48716f45

View File

@@ -12,7 +12,11 @@ import {
} from 'class-validator'
import { WriteBaseModel } from '~/shared/model/base.model'
import { IsNilOrString } from '~/utils/validator/isNilOrString'
export const pageType = ['md', 'html', 'frame']
export enum PageType {
'md' = 'md',
'html' = 'html',
'json' = 'json',
}
@modelOptions({
options: {
@@ -42,12 +46,11 @@ export class PageModel extends WriteBaseModel {
order!: number
@ApiProperty({
description: 'Type (MD | html | frame)',
enum: pageType,
enum: PageType,
required: false,
})
@prop({ default: 'md' })
@IsEnum(pageType)
@IsEnum(PageType)
@IsOptional()
type?: string
}