mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-17 05:09:26 +00:00
19 lines
368 B
TypeScript
19 lines
368 B
TypeScript
import { IsBoolean, IsOptional, Length } from 'class-validator'
|
|
import { Transform } from 'class-transformer'
|
|
|
|
export class CreateDeckDto {
|
|
@Length(3, 30)
|
|
name: string
|
|
|
|
@IsOptional()
|
|
@Length(0, 0)
|
|
cover?: string
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
@Transform((val: string) => [true, 'true', 1, '1'].indexOf(val) > -1)
|
|
isPrivate?: boolean
|
|
|
|
userId: string
|
|
}
|