Browse Source

Merge branch 'main' into task/improve-parsing-of-integer-query-parameter-include-historical-data-in-various-endpoints

pull/7208/head
Thomas Kaul 2 weeks ago
committed by GitHub
parent
commit
c9ba695960
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 9
      apps/api/src/app/admin/admin.controller.ts
  3. 9
      apps/api/src/app/endpoints/asset-profiles/asset-profiles.controller.ts

2
CHANGELOG.md

@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Restricted the modification of activity tags in the impersonation mode
- 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

9
apps/api/src/app/admin/admin.controller.ts

@ -40,6 +40,7 @@ import {
Inject,
Logger,
Param,
ParseIntPipe,
Patch,
Post,
Put,
@ -319,12 +320,12 @@ export class AdminController {
@HasPermission(permissions.accessAdminControl)
@UseGuards(AuthGuard('jwt'), HasPermissionGuard)
public async getUsers(
@Query('skip') skip?: number,
@Query('take') take?: number
@Query('skip', new ParseIntPipe({ optional: true })) skip?: number,
@Query('take', new ParseIntPipe({ optional: true })) take?: number
): Promise<AdminUsersResponse> {
return this.adminService.getUsers({
skip: isNaN(skip) ? undefined : skip,
take: isNaN(take) ? undefined : take
skip,
take
});
}

9
apps/api/src/app/endpoints/asset-profiles/asset-profiles.controller.ts

@ -22,6 +22,7 @@ import {
HttpException,
Inject,
Param,
ParseIntPipe,
Patch,
Query,
UseGuards,
@ -51,10 +52,10 @@ export class AssetProfilesController {
@Query('dataSource') filterByDataSource?: string,
@Query('presetId') presetId?: MarketDataPreset,
@Query('query') filterBySearchQuery?: string,
@Query('skip') skip?: number,
@Query('skip', new ParseIntPipe({ optional: true })) skip?: number,
@Query('sortColumn') sortColumn?: string,
@Query('sortDirection') sortDirection?: Prisma.SortOrder,
@Query('take') take?: number
@Query('take', new ParseIntPipe({ optional: true })) take?: number
): Promise<AssetProfilesResponse> {
const filters = this.apiService.buildFiltersFromQueryParams({
filterByAssetSubClasses,
@ -65,10 +66,10 @@ export class AssetProfilesController {
return this.assetProfilesService.getAssetProfiles({
filters,
presetId,
skip,
sortColumn,
sortDirection,
skip: isNaN(skip) ? undefined : skip,
take: isNaN(take) ? undefined : take
take
});
}

Loading…
Cancel
Save