Advertisement
nikolayneykov

Untitled

Nov 12th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Exclude, Expose } from 'class-transformer';
  2. import { MinLength, IsOptional, IsString, IsNotEmpty, IsNumberString } from 'class-validator';
  3.  
  4. @Exclude()
  5. export class SearchOptionsDTO {
  6.   @Expose()
  7.   @IsOptional()
  8.   @MinLength(2)
  9.   @IsNotEmpty()
  10.   keyword?: string;
  11.  
  12.   @Expose()
  13.   @IsOptional()
  14.   @IsString()
  15.   @IsNotEmpty()
  16.   order?: 'ASC' | 'DESC';
  17.  
  18.   @Expose()
  19.   @IsOptional()
  20.   @IsNumberString()
  21.   @IsNotEmpty()
  22.   take?: string;
  23.  
  24.   @Expose()
  25.   @IsOptional()
  26.   @IsNumberString()
  27.   @IsNotEmpty()
  28.   skip?: string;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement