From 8d7ebeaf7b50099b05c76e2ce354567bddcb934b Mon Sep 17 00:00:00 2001 From: Thomas <4159106+dtslvr@users.noreply.github.com> Date: Sat, 14 Aug 2021 18:48:25 +0200 Subject: [PATCH] Improve the impersonation mode in positions --- .../src/app/portfolio/portfolio.controller.ts | 10 ++++++++++ .../app/components/value/value.component.html | 16 ++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts index a9535816a..b97b016c8 100644 --- a/apps/api/src/app/portfolio/portfolio.controller.ts +++ b/apps/api/src/app/portfolio/portfolio.controller.ts @@ -213,6 +213,16 @@ export class PortfolioController { res.status(StatusCodes.ACCEPTED); } + if (impersonationId) { + result.positions = result.positions.map((position) => { + return nullifyValuesInObject(position, [ + 'grossPerformance', + 'investment', + 'quantity' + ]); + }); + } + return res.json(result); } diff --git a/apps/client/src/app/components/value/value.component.html b/apps/client/src/app/components/value/value.component.html index 67482b78e..daa585adb 100644 --- a/apps/client/src/app/components/value/value.component.html +++ b/apps/client/src/app/components/value/value.component.html @@ -1,16 +1,21 @@ - +
- +
+
-
{{ formattedValue }}%
- {{ formattedValue }} + + *** + + + {{ formattedValue }} +
{{ currency }} @@ -38,8 +43,3 @@ width: '5rem' }" > - -
- *** - {{ currency }} -