From c2f3b77c9b940c2c71a52dd0098787443e2373df Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 4 Jul 2026 11:37:28 +0200 Subject: [PATCH] Task/improve parsing of integer query parameter includeHistoricalData in various endpoints (#7208) * Improve parsing of integer query parameter includeHistoricalData * Update changelog --- CHANGELOG.md | 2 ++ .../src/app/endpoints/market-data/market-data.controller.ts | 4 +++- apps/api/src/app/symbol/symbol.controller.ts | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8f19142d..b0f53a3b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Hardened the endpoint of the public access for portfolio sharing by restricting it to public accesses - Improved the parsing of integer query parameters (`skip` and `take`) in the `GET api/v1/admin/user` endpoint - Improved the parsing of integer query parameters (`skip` and `take`) in the `GET api/v1/asset-profiles` endpoint +- Improved the parsing of the integer query parameter (`includeHistoricalData`) in the `GET api/v1/market-data/markets` endpoint +- Improved the parsing of the integer query parameter (`includeHistoricalData`) in the `GET api/v1/symbol/:dataSource/:symbol` endpoint - Improved the language localization by translating various tooltips across the application - Improved the language localization for Ukrainian (`uk`) - Upgraded `yahoo-finance2` from version `3.14.3` to `3.15.4` diff --git a/apps/api/src/app/endpoints/market-data/market-data.controller.ts b/apps/api/src/app/endpoints/market-data/market-data.controller.ts index 0905a50bb..5dad0511f 100644 --- a/apps/api/src/app/endpoints/market-data/market-data.controller.ts +++ b/apps/api/src/app/endpoints/market-data/market-data.controller.ts @@ -22,6 +22,7 @@ import { HttpException, Inject, Param, + ParseIntPipe, Post, Query, UseGuards @@ -45,7 +46,8 @@ export class MarketDataController { @HasPermission(permissions.readMarketDataOfMarkets) @UseGuards(AuthGuard('jwt'), HasPermissionGuard) public async getMarketDataOfMarkets( - @Query('includeHistoricalData') includeHistoricalData = 0 + @Query('includeHistoricalData', new ParseIntPipe({ optional: true })) + includeHistoricalData = 0 ): Promise { const [ marketDataFearAndGreedIndexCryptocurrencies, diff --git a/apps/api/src/app/symbol/symbol.controller.ts b/apps/api/src/app/symbol/symbol.controller.ts index 501692ae5..d94ffb4dc 100644 --- a/apps/api/src/app/symbol/symbol.controller.ts +++ b/apps/api/src/app/symbol/symbol.controller.ts @@ -14,6 +14,7 @@ import { HttpException, Inject, Param, + ParseIntPipe, Query, UseGuards, UseInterceptors @@ -69,7 +70,8 @@ export class SymbolController { public async getSymbolData( @Param('dataSource') dataSource: DataSource, @Param('symbol') symbol: string, - @Query('includeHistoricalData') includeHistoricalData = 0 + @Query('includeHistoricalData', new ParseIntPipe({ optional: true })) + includeHistoricalData = 0 ): Promise { if (!DataSource[dataSource]) { throw new HttpException(