@nestjs/swagger#OmitType TypeScript Examples

The following examples show how to use @nestjs/swagger#OmitType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: create-track.dto.ts    From codeclannigeria-backend with MIT License 6 votes vote down vote up
export class CreateWithThumbnailTrackDto extends OmitType(TrackDto, [
  'id',
  'createdAt',
  'updatedAt',
  'thumbnailUrl'
  // 'stages'
]) {
  @ApiProperty({ type: 'string', format: 'binary' })
  thumbnail: BufferedFile;
}
Example #2
Source File: update-user-dto.ts    From nestjs-starter with MIT License 6 votes vote down vote up
// TODO: sintetizar esto porque a lo mejor los tipados estan demas
export class UpdateUserDto extends PartialType(OmitType(CreateUserDto, ['email', 'username', 'metadata'])) {
  @ApiProperty()
  @IsOptional()
  id?: number;

  @ApiProperty()
  @IsEmailAlreadyExist({ message: 'Email $value already exists. Choose another Email.' })
  @IsEmail()
  @IsString()
  @IsOptional()
  email: string;

  @ApiProperty()
  @IsUsernameAlreadyExist({ message: 'Username $value already exists. Choose another username.' })
  @IsString()
  @MinLength(8)
  @MaxLength(20)
  @Matches(PATTERN_VALID_USERNAME, {
    message: `Username $value don't have a valid format`,
  })
  @IsOptional()
  username: string;

  @ApiProperty()
  @IsString()
  @IsOptional()
  password: string;
}
Example #3
Source File: update-profile.dto.ts    From codeclannigeria-backend with MIT License 5 votes vote down vote up
export class UpdateProfileDto extends OmitType(CreateUserDto, [
  'email',
  'role',
  'photoUrl'
]) {}
Example #4
Source File: create-task.dto.ts    From codeclannigeria-backend with MIT License 5 votes vote down vote up
@Exclude()
export class CreateTaskDto extends OmitType(TaskDto, [
  'createdAt',
  'updatedAt',
  'id'
]) {}
Example #5
Source File: create-track.dto.ts    From codeclannigeria-backend with MIT License 5 votes vote down vote up
export class CreateTrackDto extends OmitType(TrackDto, [
  'id',
  'createdAt',
  'updatedAt',
  'thumbnailUrl'
  // 'stages'
]) {}
Example #6
Source File: create-user.dto.ts    From codeclannigeria-backend with MIT License 5 votes vote down vote up
export class CreateUserDto extends OmitType(UserDto, [
  'id',
  'updatedAt',
  'createdAt',
  'tracks',
  'notifUnreadCount',
  'notifyCount'
]) {}