diff --git a/apps/api/src/app/common/dtos/Schema.dto.ts b/apps/api/src/app/common/dtos/Schema.dto.ts index a8e335629..8d648eb6b 100644 --- a/apps/api/src/app/common/dtos/Schema.dto.ts +++ b/apps/api/src/app/common/dtos/Schema.dto.ts @@ -85,11 +85,6 @@ export class SchemaDto { @ApiPropertyOptional({ description: 'List of possible values for column if type is Select', }) - @ValidateIf((object) => object.type === ColumnTypesEnum.SELECT, { - message: "'selectValues' should not empty, when type is Select", - }) - @IsArray({ message: "'selectValues' must be an array, when type is Select" }) - @ArrayMinSize(1, { message: "'selectValues' should not empty, when type is Select" }) @Type(() => Array) @IsOptional() selectValues: string[] = []; diff --git a/apps/api/src/app/review/usecases/do-review/base-review.usecase.ts b/apps/api/src/app/review/usecases/do-review/base-review.usecase.ts index 10d833c34..b5d68ba2c 100644 --- a/apps/api/src/app/review/usecases/do-review/base-review.usecase.ts +++ b/apps/api/src/app/review/usecases/do-review/base-review.usecase.ts @@ -114,7 +114,7 @@ export class BaseReview { const selectValues = Array.isArray(column.selectValues) && column.selectValues.length > 0 ? [...column.selectValues, ...(column.isRequired ? [] : [''])] - : []; + : ['']; property = { type: 'string', enum: Array.from(new Set(selectValues)), // handle duplicate