Browse Source

feat(client): resolve type errors

pull/7195/head
KenTandrian 2 weeks ago
parent
commit
5e89123b5b
  1. 10
      apps/client/src/app/pages/accounts/accounts-page.component.ts
  2. 4
      apps/client/src/app/pages/accounts/create-or-update-account-dialog/interfaces/interfaces.ts

10
apps/client/src/app/pages/accounts/accounts-page.component.ts

@ -80,7 +80,9 @@ export class GfAccountsPageComponent implements OnInit {
return id === params['accountId']; return id === params['accountId'];
}); });
this.openUpdateAccountDialog(account); if (account) {
this.openUpdateAccountDialog(account);
}
} else { } else {
this.router.navigate(['.'], { relativeTo: this.route }); this.router.navigate(['.'], { relativeTo: this.route });
} }
@ -267,13 +269,13 @@ export class GfAccountsPageComponent implements OnInit {
account: { account: {
balance: 0, balance: 0,
comment: null, comment: null,
currency: this.user?.settings?.baseCurrency, currency: this.user?.settings?.baseCurrency ?? null,
id: null, id: null,
isExcluded: false, isExcluded: false,
name: null, name: null,
platformId: null platformId: null
} }
}, } satisfies CreateOrUpdateAccountDialogParams,
height: this.deviceType === 'mobile' ? '98vh' : '80vh', height: this.deviceType === 'mobile' ? '98vh' : '80vh',
width: this.deviceType === 'mobile' ? '100vw' : '50rem' width: this.deviceType === 'mobile' ? '100vw' : '50rem'
}); });
@ -353,7 +355,7 @@ export class GfAccountsPageComponent implements OnInit {
} }
private reset() { private reset() {
this.accounts = undefined; this.accounts = [];
this.activitiesCount = 0; this.activitiesCount = 0;
this.totalBalanceInBaseCurrency = 0; this.totalBalanceInBaseCurrency = 0;
this.totalValueInBaseCurrency = 0; this.totalValueInBaseCurrency = 0;

4
apps/client/src/app/pages/accounts/create-or-update-account-dialog/interfaces/interfaces.ts

@ -1,5 +1,7 @@
import { Account } from '@prisma/client'; import { Account } from '@prisma/client';
export interface CreateOrUpdateAccountDialogParams { export interface CreateOrUpdateAccountDialogParams {
account: Omit<Account, 'createdAt' | 'updatedAt' | 'userId'>; account: Omit<Account, 'createdAt' | 'id' | 'updatedAt' | 'userId'> & {
id: string | null;
};
} }

Loading…
Cancel
Save