src/models/category/dto/find-categories.dto.ts
Describes the information to search for categories
Properties |
|
Optional categoryName |
Type : string
|
Decorators :
@IsOptional()
|
String containing in category name
|
Optional offset |
Type : number
|
Decorators :
@IsOptional()
|
Show this amount of categories per page
|
Optional page |
Type : number
|
Decorators :
@IsOptional()
|
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;
}