From 6dac46dcdc5ff6b9becb96aeec7d7b1f726ca1e3 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 28 Jun 2026 09:38:25 +0200 Subject: [PATCH] Bugfix/base currency for total value calculation in public controller (#7157) * Fix base currency * Update changelog --- CHANGELOG.md | 1 + apps/api/src/app/endpoints/public/public.controller.ts | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 199b0b383..8af2fe3d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` diff --git a/apps/api/src/app/endpoints/public/public.controller.ts b/apps/api/src/app/endpoints/public/public.controller.ts index d0e459f01..d06e3b5fe 100644 --- a/apps/api/src/app/endpoints/public/public.controller.ts +++ b/apps/api/src/app/endpoints/public/public.controller.ts @@ -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 ) ); })