Skip to content

Commit

Permalink
change validation dto
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelo Manganiello committed Dec 1, 2020
1 parent 16dad6b commit 7bdcef9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const uniqueEnums = {}; %><%- include imports -%>
<%_ if (!hasDto && importApiModelProperty === true) { _%>
import { ApiModelProperty } from '@nestjs/swagger';
<%_ } if (validation) { _%>
import {validate, Contains, IsInt, Length, IsEmail, IsFQDN, IsDate, Min, Max} from "class-validator";
import { validate, Contains, IsInt, Length, IsEmail, IsFQDN, IsDate, Min, Max } from "class-validator";
<%_ } _%>

<%_ Object.keys(uniqueEntities).forEach(function(entityClass) { _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { ApiModelProperty } from '@nestjs/swagger';
import { IsString } from 'class-validator';
import { IsEmail } from 'class-validator';

/**
* A DTO representing a password change required data - current and new password.
*/
export class PasswordChangeDTO {
@ApiModelProperty({ description: 'Current password', required: true })
@IsString()
@IsEmail()
readonly currentPassword: string;

@ApiModelProperty({ description: 'New password', required: true })
@IsString()
@IsEmail()
readonly newPassword: string;
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { ApiModelProperty } from '@nestjs/swagger';
import { IsString } from 'class-validator';
import { IsString, IsEmail } from 'class-validator';

/**
* A DTO representing a login user.
*/
export class UserLoginDTO {

@ApiModelProperty({ description: 'User password', required: true })
@IsString()
@IsEmail()
readonly password: string;

@ApiModelProperty({ description: 'User remember login', required: false })
Expand Down

0 comments on commit 7bdcef9

Please sign in to comment.