Feature/validate url in create and update platform dto (#3235)

* Validate url

* Update changelog
This commit is contained in:
Thomas Kaul
2024-04-04 09:08:37 +02:00
committed by GitHub
parent 82fe1de1a7
commit f1f4f6247d
3 changed files with 14 additions and 4 deletions

View File

@@ -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;
}

View File

@@ -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;
}