add cover to deck create/update

This commit is contained in:
andres
2023-07-16 14:59:03 +02:00
parent f2437db3b7
commit 2f1579ed48
5 changed files with 65 additions and 12 deletions

View File

@@ -1,15 +1,17 @@
import { IsBoolean, IsOptional, IsString, Length } from 'class-validator'
import { IsBoolean, IsOptional, Length } from 'class-validator'
import { Transform } from 'class-transformer'
export class CreateDeckDto {
@Length(3, 30)
name: string
@IsOptional()
@IsString()
@Length(0, 0)
cover?: string
@IsOptional()
@IsBoolean()
@Transform((val: string) => [true, 'true', 1, '1'].indexOf(val) > -1)
isPrivate?: boolean
userId: string