File

src/models/category/dto/find-categories.dto.ts

Description

Describes the information to search for categories

Index

Properties

Properties

Optional categoryName
Type : string
Decorators :
@IsOptional()
@IsString()

String containing in category name

Optional offset
Type : number
Decorators :
@IsOptional()
@Type(undefined)
@IsInt()
@IsPositive()

Show this amount of categories per page

Optional page
Type : number
Decorators :
@IsOptional()
@Type(undefined)
@IsInt()
@IsPositive()

Show categories in this page

import { Type } from 'class-transformer';
import { IsInt, IsOptional, IsPositive, IsString } from 'class-validator';

/** Describes the information to search for categories */
export class FindCategoriesDto {
  /** String containing in category name
   * @example "chair"
   */
  @IsOptional()
  @IsString()
  categoryName?: string;

  /** Show categories in this page
   * @example 1
   */
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @IsPositive()
  page?: number;

  /** Show this amount of categories per page
   * @example 10
   */
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @IsPositive()
  offset?: number;
}

results matching ""

    No results matching ""