I have a scope dto class:
export class UpdateProgramScopeDto {
@Matches(scopeTypeRegex)
@ApiProperty({
type: String,
description: 'scopeType',
enum: SCOPE_TYPE,
})
scopeType: SCOPE_TYPE;
}
and what to use that in another class:
export class RegisterProgramDto {
@IsArray()
@ValidateNested({ message: 'd' })
@Type(() => UpdateProgramScopeDto)
@ApiProperty({
type: UpdateProgramScopeDto,
description: 'scopes',
isArray: true,
})
scopes: UpdateProgramScopeDto[];
}
but error messages of scope class isn't sended how can I fix that?
@Post()
async registerProgram(
@Body(ValidationPipe) registerProgramDto: RegisterProgramDto,
@User() user: AuthEntity,
) {
return await this._programService.registerProgram(
user.user_id,
registerProgramDto,
);
}