Browse Source

Task/improve parsing of integer query parameter includeHistoricalData in various endpoints (#7208)

* Improve parsing of integer query parameter includeHistoricalData

* Update changelog
pull/7211/head
Thomas Kaul 2 weeks ago
committed by GitHub
parent
commit
c2f3b77c9b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 4
      apps/api/src/app/endpoints/market-data/market-data.controller.ts
  3. 4
      apps/api/src/app/symbol/symbol.controller.ts

2
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 - 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/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 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 by translating various tooltips across the application
- Improved the language localization for Ukrainian (`uk`) - Improved the language localization for Ukrainian (`uk`)
- Upgraded `yahoo-finance2` from version `3.14.3` to `3.15.4` - Upgraded `yahoo-finance2` from version `3.14.3` to `3.15.4`

4
apps/api/src/app/endpoints/market-data/market-data.controller.ts

@ -22,6 +22,7 @@ import {
HttpException, HttpException,
Inject, Inject,
Param, Param,
ParseIntPipe,
Post, Post,
Query, Query,
UseGuards UseGuards
@ -45,7 +46,8 @@ export class MarketDataController {
@HasPermission(permissions.readMarketDataOfMarkets) @HasPermission(permissions.readMarketDataOfMarkets)
@UseGuards(AuthGuard('jwt'), HasPermissionGuard) @UseGuards(AuthGuard('jwt'), HasPermissionGuard)
public async getMarketDataOfMarkets( public async getMarketDataOfMarkets(
@Query('includeHistoricalData') includeHistoricalData = 0 @Query('includeHistoricalData', new ParseIntPipe({ optional: true }))
includeHistoricalData = 0
): Promise<MarketDataOfMarketsResponse> { ): Promise<MarketDataOfMarketsResponse> {
const [ const [
marketDataFearAndGreedIndexCryptocurrencies, marketDataFearAndGreedIndexCryptocurrencies,

4
apps/api/src/app/symbol/symbol.controller.ts

@ -14,6 +14,7 @@ import {
HttpException, HttpException,
Inject, Inject,
Param, Param,
ParseIntPipe,
Query, Query,
UseGuards, UseGuards,
UseInterceptors UseInterceptors
@ -69,7 +70,8 @@ export class SymbolController {
public async getSymbolData( public async getSymbolData(
@Param('dataSource') dataSource: DataSource, @Param('dataSource') dataSource: DataSource,
@Param('symbol') symbol: string, @Param('symbol') symbol: string,
@Query('includeHistoricalData') includeHistoricalData = 0 @Query('includeHistoricalData', new ParseIntPipe({ optional: true }))
includeHistoricalData = 0
): Promise<SymbolItem> { ): Promise<SymbolItem> {
if (!DataSource[dataSource]) { if (!DataSource[dataSource]) {
throw new HttpException( throw new HttpException(

Loading…
Cancel
Save