Files
flashcards-api/src/modules/decks/dto/get-all-decks.dto.ts
andres 3ab74f812d fix: correct type for maxCardsCount and minCardsCount
fix: correct default html for password recovery
2023-12-04 19:50:30 +01:00

39 lines
1014 B
TypeScript

import { ApiHideProperty } from '@nestjs/swagger'
import { Type } from 'class-transformer'
import { IsNumber, IsOptional, IsUUID } from 'class-validator'
import { PaginationDto } from '../../../infrastructure/common/pagination/pagination.dto'
import { IsOptionalOrEmptyString, IsOrderBy } from '../../../infrastructure/decorators'
export class GetAllDecksDto extends PaginationDto {
@IsOptional()
@Type(() => Number)
@IsNumber()
minCardsCount?: number
@IsOptional()
@Type(() => Number)
@IsNumber()
maxCardsCount?: number
/** Search by deck name */
@IsOptionalOrEmptyString()
name?: string
/** Filter by deck authorId */
@IsOptionalOrEmptyString()
@IsUUID(4)
authorId?: string
@ApiHideProperty()
userId?: string
/** A string that represents the name of the field to order by and the order direction.
* The format is: "field_name-order_direction".
* Available directions: "asc" and "desc".
* @example "name-desc"
* */
@IsOrderBy()
orderBy?: string | null
}