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'];
});
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;

4
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, 'createdAt' | 'updatedAt' | 'userId'>;
account: Omit<Account, 'createdAt' | 'id' | 'updatedAt' | 'userId'> & {
id: string | null;
};
}

Loading…
Cancel
Save