mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-31 20:59:26 +00:00
file upload in progress
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Length } from 'class-validator'
|
||||
import { IsOptional, Length } from 'class-validator'
|
||||
|
||||
export class CreateCardDto {
|
||||
@Length(3, 500)
|
||||
@@ -6,4 +6,20 @@ export class CreateCardDto {
|
||||
|
||||
@Length(3, 500)
|
||||
answer: string
|
||||
|
||||
@IsOptional()
|
||||
@Length(3, 500)
|
||||
questionImg?: string
|
||||
|
||||
@IsOptional()
|
||||
@Length(3, 500)
|
||||
answerImg?: string
|
||||
|
||||
@IsOptional()
|
||||
@Length(3, 500)
|
||||
questionVideo?: string
|
||||
|
||||
@IsOptional()
|
||||
@Length(3, 500)
|
||||
answerVideo?: string
|
||||
}
|
||||
|
||||
@@ -1,16 +1,4 @@
|
||||
import { PartialType } from '@nestjs/mapped-types'
|
||||
import { CreateCardDto } from './create-card.dto'
|
||||
import { IsOptionalOrEmptyString } from '../../../infrastructure/decorators/is-optional-or-empty-string'
|
||||
import { IsBoolean } from 'class-validator'
|
||||
|
||||
export class UpdateCardDto extends PartialType(CreateCardDto) {
|
||||
@IsOptionalOrEmptyString()
|
||||
name: string
|
||||
|
||||
@IsOptionalOrEmptyString()
|
||||
@IsBoolean()
|
||||
isPrivate: boolean
|
||||
|
||||
@IsOptionalOrEmptyString()
|
||||
cover: string
|
||||
}
|
||||
export class UpdateCardDto extends PartialType(CreateCardDto) {}
|
||||
|
||||
Reference in New Issue
Block a user