19 lines
488 B
TypeScript
19 lines
488 B
TypeScript
import { Transform } from 'class-transformer';
|
|
import { IsOptional, IsString, MaxLength, MinLength } from 'class-validator';
|
|
|
|
export class UpdateRoleDto {
|
|
@Transform(({ value }) => (typeof value === 'string' ? value.trim() : value))
|
|
@IsOptional()
|
|
@IsString()
|
|
@MinLength(1)
|
|
@MaxLength(120)
|
|
name?: string;
|
|
|
|
@Transform(({ value }) => (typeof value === 'string' ? value.trim() : value))
|
|
@IsOptional()
|
|
@IsString()
|
|
@MinLength(1)
|
|
@MaxLength(1000)
|
|
description?: string;
|
|
}
|