mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-18 05:09:29 +00:00
add smart random
This commit is contained in:
10
src/modules/decks/dto/create-grade.dto.ts
Normal file
10
src/modules/decks/dto/create-grade.dto.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { IsUUID, Max, Min } from 'class-validator'
|
||||
|
||||
export class CreateDeckDto {
|
||||
@Min(1)
|
||||
@Max(5)
|
||||
grade: number
|
||||
|
||||
@IsUUID()
|
||||
cardId: string
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import { IsUUID } from 'class-validator'
|
||||
import { IsOptionalOrEmptyString } from '../../../infrastructure/decorators/is-optional-or-empty-string'
|
||||
import { PaginationDto } from '../../../infrastructure/common/pagination/pagination.dto'
|
||||
import { IsOrderBy } from '../../../infrastructure/decorators/is-order-by-constraint'
|
||||
|
||||
export class GetAllDecksDto extends PaginationDto {
|
||||
@IsOptionalOrEmptyString()
|
||||
@@ -17,4 +18,7 @@ export class GetAllDecksDto extends PaginationDto {
|
||||
authorId?: string
|
||||
|
||||
userId: string
|
||||
|
||||
@IsOrderBy()
|
||||
orderBy?: string | null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user