From e9007f301ca90d4088a60e881bfba6c2fc2a776c Mon Sep 17 00:00:00 2001 From: Akash Negi <95514575+AkashNegi1@users.noreply.github.com> Date: Thu, 2 Jul 2026 00:26:36 +0530 Subject: [PATCH] Bugfix/data source validation of create asset profile with market data DTO (#7173) * Fix data source validation * Update changelog --- CHANGELOG.md | 1 + .../src/lib/dtos/create-asset-profile-with-market-data.dto.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e3abcb9d..b90ca4a67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed the validation of the data source field of an asset profile with market data - Fixed a recurring issue where single-value fields were incorrectly validated as arrays in various endpoints ## 3.18.0 - 2026-06-28 diff --git a/libs/common/src/lib/dtos/create-asset-profile-with-market-data.dto.ts b/libs/common/src/lib/dtos/create-asset-profile-with-market-data.dto.ts index 04611371d..51ee716d3 100644 --- a/libs/common/src/lib/dtos/create-asset-profile-with-market-data.dto.ts +++ b/libs/common/src/lib/dtos/create-asset-profile-with-market-data.dto.ts @@ -1,12 +1,12 @@ import { MarketData } from '@ghostfolio/common/interfaces'; import { DataSource } from '@prisma/client'; -import { IsArray, IsEnum, IsOptional } from 'class-validator'; +import { IsArray, IsIn, IsOptional } from 'class-validator'; import { CreateAssetProfileDto } from './create-asset-profile.dto'; export class CreateAssetProfileWithMarketDataDto extends CreateAssetProfileDto { - @IsEnum([DataSource.MANUAL], { + @IsIn([DataSource.MANUAL], { message: `dataSource must be '${DataSource.MANUAL}'` }) dataSource: DataSource;