From 7ad815fe9aa7ccef97022b2b108cbe91372090a8 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:47:42 +0200 Subject: [PATCH] Handle non-existent access --- apps/api/src/app/portfolio/portfolio.controller.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts index 19f48fa86..84d4ef532 100644 --- a/apps/api/src/app/portfolio/portfolio.controller.ts +++ b/apps/api/src/app/portfolio/portfolio.controller.ts @@ -496,9 +496,6 @@ export class PortfolioController { @Param('accessId') accessId ): Promise { const access = await this.accessService.access({ id: accessId }); - const user = await this.userService.user({ - id: access.userId - }); if (!access) { throw new HttpException( @@ -508,6 +505,11 @@ export class PortfolioController { } let hasDetails = true; + + const user = await this.userService.user({ + id: access.userId + }); + if (this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) { hasDetails = user.subscription.type === 'Premium'; }