Advertisement
nikolayneykov

Untitled

Oct 6th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Exclude, Expose, Transform } from 'class-transformer';
  2. import { IsOptional } from 'class-validator';
  3. import { Like } from 'typeorm';
  4.  
  5. @Exclude()
  6. export class SearchUsersDTO {
  7.   @Expose()
  8.   @IsOptional()
  9.   @Transform((value) => Like(`%${value || ''}%`))
  10.   public username: string;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement