This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { IsString, IsOptional, IsBoolean, IsInt, Min, IsEnum, IsNotEmpty } from 'class-validator';
|
||||
import { ApiPropertyOptional, ApiProperty } from '@nestjs/swagger';
|
||||
import { Type } from 'class-transformer';
|
||||
import { FieldType } from '../interface/print';
|
||||
import { EntityType, FieldType } from '../interface/print';
|
||||
|
||||
export class CreateFieldDto {
|
||||
@IsString()
|
||||
@@ -23,6 +23,12 @@ export class CreateFieldDto {
|
||||
@ApiProperty({ enum: FieldType, example: FieldType.select })
|
||||
type: FieldType;
|
||||
|
||||
@IsNotEmpty()
|
||||
@IsEnum(EntityType)
|
||||
@ApiProperty({ enum: EntityType, example: EntityType.product })
|
||||
entityType: EntityType
|
||||
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
|
||||
Reference in New Issue
Block a user