Browse Source
Bugfix/base currency for total value calculation in public controller (#7157)
* Fix base currency
* Update changelog
pull/7156/head^2
Thomas Kaul
2 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
2 additions and
6 deletions
-
CHANGELOG.md
-
apps/api/src/app/endpoints/public/public.controller.ts
|
|
|
@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Fixed the base currency for the total value calculation in the public access for portfolio sharing |
|
|
|
- Fixed an issue in the public access for portfolio sharing that exposed absolute values of the top holdings of ETFs |
|
|
|
- Fixed the time zone handling in the `api` test suite for deterministic execution in `UTC` |
|
|
|
|
|
|
|
|
|
|
|
@ -13,17 +13,14 @@ import { |
|
|
|
AccessSettings, |
|
|
|
PublicPortfolioResponse |
|
|
|
} from '@ghostfolio/common/interfaces'; |
|
|
|
import type { RequestWithUser } from '@ghostfolio/common/types'; |
|
|
|
|
|
|
|
import { |
|
|
|
Controller, |
|
|
|
Get, |
|
|
|
HttpException, |
|
|
|
Inject, |
|
|
|
Param, |
|
|
|
UseInterceptors |
|
|
|
} from '@nestjs/common'; |
|
|
|
import { REQUEST } from '@nestjs/core'; |
|
|
|
import { |
|
|
|
AssetClass, |
|
|
|
AssetSubClass, |
|
|
|
@ -40,7 +37,6 @@ export class PublicController { |
|
|
|
private readonly configurationService: ConfigurationService, |
|
|
|
private readonly exchangeRateDataService: ExchangeRateDataService, |
|
|
|
private readonly portfolioService: PortfolioService, |
|
|
|
@Inject(REQUEST) private readonly request: RequestWithUser, |
|
|
|
private readonly userService: UserService |
|
|
|
) {} |
|
|
|
|
|
|
|
@ -168,8 +164,7 @@ export class PublicController { |
|
|
|
this.exchangeRateDataService.toCurrency( |
|
|
|
quantity * marketPrice, |
|
|
|
assetProfile.currency, |
|
|
|
this.request.user?.settings?.settings.baseCurrency ?? |
|
|
|
DEFAULT_CURRENCY |
|
|
|
user.settings?.settings.baseCurrency ?? DEFAULT_CURRENCY |
|
|
|
) |
|
|
|
); |
|
|
|
}) |
|
|
|
|