diff --git a/CHANGELOG.md b/CHANGELOG.md index b31046e8cd..97f9f003d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Fixed + +- Fixed the validation of an empty url in the asset profile dialog of the admin control panel + ## 3.39.0 - 2026-08-01 ### Changed diff --git a/libs/common/src/lib/dtos/update-asset-profile.dto.ts b/libs/common/src/lib/dtos/update-asset-profile.dto.ts index a6e2230e8e..35a4025a8b 100644 --- a/libs/common/src/lib/dtos/update-asset-profile.dto.ts +++ b/libs/common/src/lib/dtos/update-asset-profile.dto.ts @@ -7,7 +7,7 @@ import { DataSource, Prisma } from '@prisma/client'; -import { Type } from 'class-transformer'; +import { Transform, TransformFnParams, Type } from 'class-transformer'; import { IsArray, IsBoolean, @@ -18,6 +18,7 @@ import { IsUrl, ValidateNested } from 'class-validator'; +import { isString } from 'lodash'; import { CountryDto } from './country.dto'; import { HoldingDto } from './holding.dto'; @@ -96,5 +97,8 @@ export class UpdateAssetProfileDto { protocols: ['http', 'https'], require_protocol: true }) + @Transform(({ value }: TransformFnParams) => + isString(value) && value.trim() === '' ? undefined : value + ) url?: string; }