File tree Expand file tree Collapse file tree 2 files changed +6
-16
lines changed
Expand file tree Collapse file tree 2 files changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -12,33 +12,23 @@ import { RequestBody } from '../../core/api/RequestBody';
1212 */
1313export class UserUpdateRequest extends RequestBody {
1414
15- @IsNotEmpty ( )
16- id : number ;
17-
1815 @IsNotEmpty ( )
1916 firstName : string ;
2017
2118 @IsNotEmpty ( )
2219 lastName : string ;
2320
24- @IsNotEmpty ( )
2521 @IsEmail ( )
2622 email : string ;
2723
24+ @IsNotEmpty ( )
2825 picture : string ;
2926
27+ @IsNotEmpty ( )
3028 auth0UserId : string ;
3129
32- setFirstName ( value : string ) : void {
33- this . update ( 'firstName' , value ) ;
34- }
35-
36- setLastName ( value : string ) : void {
37- this . update ( 'lastName' , value ) ;
38- }
39-
40- setEmail ( value : string ) : void {
41- this . update ( 'email' , value ) ;
30+ public async validate ( ) : Promise < void > {
31+ return super . validate ( true ) ;
4232 }
4333
4434}
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ export class RequestBody {
2828 /**
2929 * Validates the body on the basis of the validator-annotations
3030 */
31- public async validate ( ) : Promise < void > {
32- const errors = await validate ( this ) ;
31+ public async validate ( skipMissingProperties : boolean = false ) : Promise < void > {
32+ const errors = await validate ( this , { skipMissingProperties : skipMissingProperties } ) ;
3333 if ( errors && errors . length > 0 ) {
3434 throw new ValidationException ( 'Request body is not valid' , errors ) ;
3535 }
You can’t perform that action at this time.
0 commit comments