-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #455 from internxt/feat/pb-3593-migrate-user-endpo…
…ints [PB-3601] feat: migrate user endpoints
- Loading branch information
Showing
5 changed files
with
435 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { | ||
IsNotEmpty, | ||
IsOptional, | ||
IsString, | ||
MaxLength, | ||
ValidateIf, | ||
} from 'class-validator'; | ||
import { UserAttributes } from '../user.attributes'; | ||
|
||
export class UpdateProfileDto { | ||
@IsOptional() | ||
@IsString() | ||
@ValidateIf((o) => o.name !== null) | ||
@IsNotEmpty({ message: 'Name should not be empty if provided.' }) | ||
@MaxLength(100, { message: 'Name must be at most 100 characters long.' }) | ||
@ApiProperty({ | ||
example: 'Internxt', | ||
description: 'Name of the new user', | ||
}) | ||
name?: UserAttributes['name']; | ||
|
||
@ValidateIf((o) => o.name === null) | ||
@IsNotEmpty({ message: 'Name should not be null if provided.' }) | ||
@ApiProperty({ | ||
example: 'Internxt', | ||
description: 'Name of the new user', | ||
}) | ||
nameNullCheck?: string; | ||
|
||
@IsOptional() | ||
@IsString() | ||
@ValidateIf((o) => o.lastname !== null) | ||
@MaxLength(100, { message: 'Lastname must be at most 100 characters long.' }) | ||
@ApiProperty({ | ||
example: 'Lastname', | ||
description: 'Last name of the new user', | ||
}) | ||
lastname?: UserAttributes['lastname']; | ||
|
||
@ValidateIf((o) => o.lastname === null) | ||
@IsNotEmpty({ message: 'Lastname should not be null if provided.' }) | ||
@ApiProperty({ | ||
example: 'Lastname', | ||
description: 'Last name of the new user', | ||
}) | ||
lastnameNullCheck?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.