diff --git a/CHANGELOG.md b/CHANGELOG.md index cef6cde60..c57e7ef19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Improved the url validation in the create and update platform endpoint - Improved the language localization for German (`de`) ## 2.70.0 - 2024-04-02 diff --git a/apps/api/src/app/platform/create-platform.dto.ts b/apps/api/src/app/platform/create-platform.dto.ts index a61f21743..941354c11 100644 --- a/apps/api/src/app/platform/create-platform.dto.ts +++ b/apps/api/src/app/platform/create-platform.dto.ts @@ -1,9 +1,12 @@ -import { IsString } from 'class-validator'; +import { IsString, IsUrl } from 'class-validator'; export class CreatePlatformDto { @IsString() name: string; - @IsString() + @IsUrl({ + protocols: ['https'], + require_protocol: true + }) url: string; } diff --git a/apps/api/src/app/platform/update-platform.dto.ts b/apps/api/src/app/platform/update-platform.dto.ts index ec6f2687c..4c4f907af 100644 --- a/apps/api/src/app/platform/update-platform.dto.ts +++ b/apps/api/src/app/platform/update-platform.dto.ts @@ -1,4 +1,4 @@ -import { IsString } from 'class-validator'; +import { IsString, IsUrl } from 'class-validator'; export class UpdatePlatformDto { @IsString() @@ -7,6 +7,9 @@ export class UpdatePlatformDto { @IsString() name: string; - @IsString() + @IsUrl({ + protocols: ['https'], + require_protocol: true + }) url: string; }