|
|
@ -13,17 +13,14 @@ import { |
|
|
AccessSettings, |
|
|
AccessSettings, |
|
|
PublicPortfolioResponse |
|
|
PublicPortfolioResponse |
|
|
} from '@ghostfolio/common/interfaces'; |
|
|
} from '@ghostfolio/common/interfaces'; |
|
|
import type { RequestWithUser } from '@ghostfolio/common/types'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
Controller, |
|
|
Controller, |
|
|
Get, |
|
|
Get, |
|
|
HttpException, |
|
|
HttpException, |
|
|
Inject, |
|
|
|
|
|
Param, |
|
|
Param, |
|
|
UseInterceptors |
|
|
UseInterceptors |
|
|
} from '@nestjs/common'; |
|
|
} from '@nestjs/common'; |
|
|
import { REQUEST } from '@nestjs/core'; |
|
|
|
|
|
import { |
|
|
import { |
|
|
AssetClass, |
|
|
AssetClass, |
|
|
AssetSubClass, |
|
|
AssetSubClass, |
|
|
@ -40,7 +37,6 @@ export class PublicController { |
|
|
private readonly configurationService: ConfigurationService, |
|
|
private readonly configurationService: ConfigurationService, |
|
|
private readonly exchangeRateDataService: ExchangeRateDataService, |
|
|
private readonly exchangeRateDataService: ExchangeRateDataService, |
|
|
private readonly portfolioService: PortfolioService, |
|
|
private readonly portfolioService: PortfolioService, |
|
|
@Inject(REQUEST) private readonly request: RequestWithUser, |
|
|
|
|
|
private readonly userService: UserService |
|
|
private readonly userService: UserService |
|
|
) {} |
|
|
) {} |
|
|
|
|
|
|
|
|
@ -168,8 +164,7 @@ export class PublicController { |
|
|
this.exchangeRateDataService.toCurrency( |
|
|
this.exchangeRateDataService.toCurrency( |
|
|
quantity * marketPrice, |
|
|
quantity * marketPrice, |
|
|
assetProfile.currency, |
|
|
assetProfile.currency, |
|
|
this.request.user?.settings?.settings.baseCurrency ?? |
|
|
user.settings?.settings.baseCurrency ?? DEFAULT_CURRENCY |
|
|
DEFAULT_CURRENCY |
|
|
|
|
|
) |
|
|
) |
|
|
); |
|
|
); |
|
|
}) |
|
|
}) |
|
|
|