Browse Source

Bugfix/fix activities import (#3095)

* Fix query parameter handling of booleans

* Update changelog
pull/3097/head
Thomas Kaul 7 months ago
committed by GitHub
parent
commit
c37ad9bad4
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      CHANGELOG.md
  2. 4
      apps/api/src/app/import/import.controller.ts
  3. 7
      apps/api/src/app/portfolio/portfolio.controller.ts
  4. 4
      apps/api/src/app/symbol/symbol.controller.ts

4
CHANGELOG.md

@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Optimized the calculation of the portfolio summary - Optimized the calculation of the portfolio summary
### Fixed
- Fixed the the activities import (query parameter handling)
## 2.60.0 - 2024-03-02 ## 2.60.0 - 2024-03-02
### Added ### Added

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

@ -43,8 +43,10 @@ export class ImportController {
@UseInterceptors(TransformDataSourceInResponseInterceptor) @UseInterceptors(TransformDataSourceInResponseInterceptor)
public async import( public async import(
@Body() importData: ImportDataDto, @Body() importData: ImportDataDto,
@Query('dryRun') isDryRun = false @Query('dryRun') isDryRunParam = 'false'
): Promise<ImportResponse> { ): Promise<ImportResponse> {
const isDryRun = isDryRunParam === 'true';
if ( if (
!hasPermission(this.request.user.permissions, permissions.createAccount) !hasPermission(this.request.user.permissions, permissions.createAccount)
) { ) {

7
apps/api/src/app/portfolio/portfolio.controller.ts

@ -342,9 +342,12 @@ export class PortfolioController {
@Query('assetClasses') filterByAssetClasses?: string, @Query('assetClasses') filterByAssetClasses?: string,
@Query('range') dateRange: DateRange = 'max', @Query('range') dateRange: DateRange = 'max',
@Query('tags') filterByTags?: string, @Query('tags') filterByTags?: string,
@Query('withExcludedAccounts') withExcludedAccounts = false, @Query('withExcludedAccounts') withExcludedAccountsParam = 'false',
@Query('withItems') withItems = false @Query('withItems') withItemsParam = 'false'
): Promise<PortfolioPerformanceResponse> { ): Promise<PortfolioPerformanceResponse> {
const withExcludedAccounts = withExcludedAccountsParam === 'true';
const withItems = withItemsParam === 'true';
const hasReadRestrictedAccessPermission = const hasReadRestrictedAccessPermission =
this.userService.hasReadRestrictedAccessPermission({ this.userService.hasReadRestrictedAccessPermission({
impersonationId, impersonationId,

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

@ -39,9 +39,11 @@ export class SymbolController {
@UseGuards(AuthGuard('jwt'), HasPermissionGuard) @UseGuards(AuthGuard('jwt'), HasPermissionGuard)
@UseInterceptors(TransformDataSourceInResponseInterceptor) @UseInterceptors(TransformDataSourceInResponseInterceptor)
public async lookupSymbol( public async lookupSymbol(
@Query('includeIndices') includeIndices = false, @Query('includeIndices') includeIndicesParam = 'false',
@Query('query') query = '' @Query('query') query = ''
): Promise<{ items: LookupItem[] }> { ): Promise<{ items: LookupItem[] }> {
const includeIndices = includeIndicesParam === 'true';
try { try {
return this.symbolService.lookup({ return this.symbolService.lookup({
includeIndices, includeIndices,

Loading…
Cancel
Save