From 083faf32ec5dc89657462dec687d56835427e8bf Mon Sep 17 00:00:00 2001 From: Adeyemi Gbenga Date: Mon, 28 Apr 2025 20:26:58 +0100 Subject: [PATCH] fix: remove validation from picture url --- backend/src/users/dto/update-avatar.dto.ts | 4 ++-- backend/src/users/dto/update-username.dto.ts | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/backend/src/users/dto/update-avatar.dto.ts b/backend/src/users/dto/update-avatar.dto.ts index b4c15c2..dbaeebd 100644 --- a/backend/src/users/dto/update-avatar.dto.ts +++ b/backend/src/users/dto/update-avatar.dto.ts @@ -1,6 +1,6 @@ -import { IsUrl } from 'class-validator'; +import { IsString } from 'class-validator'; export class UpdateAvatarDto { - @IsUrl({}, { message: 'Picture must be a valid URL' }) + @IsString() picture: string; } diff --git a/backend/src/users/dto/update-username.dto.ts b/backend/src/users/dto/update-username.dto.ts index 16b9ceb..fa6d551 100644 --- a/backend/src/users/dto/update-username.dto.ts +++ b/backend/src/users/dto/update-username.dto.ts @@ -1,4 +1,10 @@ -import { IsNotEmpty, IsOptional, IsString, IsUrl, Length, Matches } from 'class-validator'; +import { + IsNotEmpty, + IsOptional, + IsString, + Length, + Matches, +} from 'class-validator'; export class UpdateUsernameDto { @IsString() @@ -9,7 +15,7 @@ export class UpdateUsernameDto { }) username: string; - @IsUrl() + @IsString() @IsOptional() picture: string; }