From 5e89123b5b57cdd877db15e12958125e8068e6e9 Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Fri, 3 Jul 2026 21:02:58 +0700 Subject: [PATCH] feat(client): resolve type errors --- .../src/app/pages/accounts/accounts-page.component.ts | 10 ++++++---- .../interfaces/interfaces.ts | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/client/src/app/pages/accounts/accounts-page.component.ts b/apps/client/src/app/pages/accounts/accounts-page.component.ts index cca1eda03..8ff389404 100644 --- a/apps/client/src/app/pages/accounts/accounts-page.component.ts +++ b/apps/client/src/app/pages/accounts/accounts-page.component.ts @@ -80,7 +80,9 @@ export class GfAccountsPageComponent implements OnInit { return id === params['accountId']; }); - this.openUpdateAccountDialog(account); + if (account) { + this.openUpdateAccountDialog(account); + } } else { this.router.navigate(['.'], { relativeTo: this.route }); } @@ -267,13 +269,13 @@ export class GfAccountsPageComponent implements OnInit { account: { balance: 0, comment: null, - currency: this.user?.settings?.baseCurrency, + currency: this.user?.settings?.baseCurrency ?? null, id: null, isExcluded: false, name: null, platformId: null } - }, + } satisfies CreateOrUpdateAccountDialogParams, height: this.deviceType === 'mobile' ? '98vh' : '80vh', width: this.deviceType === 'mobile' ? '100vw' : '50rem' }); @@ -353,7 +355,7 @@ export class GfAccountsPageComponent implements OnInit { } private reset() { - this.accounts = undefined; + this.accounts = []; this.activitiesCount = 0; this.totalBalanceInBaseCurrency = 0; this.totalValueInBaseCurrency = 0; diff --git a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/interfaces/interfaces.ts b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/interfaces/interfaces.ts index a3e6272f8..469ebc844 100644 --- a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/interfaces/interfaces.ts +++ b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/interfaces/interfaces.ts @@ -1,5 +1,7 @@ import { Account } from '@prisma/client'; export interface CreateOrUpdateAccountDialogParams { - account: Omit; + account: Omit & { + id: string | null; + }; }