From eab98a13b78b361b6aa546c550bd5e5ee9c33a35 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 28 Jul 2022 17:30:10 +0200 Subject: [PATCH] feat(webapp): get account details from input --- src/components/atoms/AtomHeroText.vue | 17 ++++ .../molecules/MoleculeDataTable.vue | 5 +- src/components/services/bank.service.ts | 3 + src/components/views/BankView.vue | 84 ++++++++++++++++--- src/components/views/CheckInView.vue | 9 +- 5 files changed, 96 insertions(+), 22 deletions(-) create mode 100644 src/components/atoms/AtomHeroText.vue diff --git a/src/components/atoms/AtomHeroText.vue b/src/components/atoms/AtomHeroText.vue new file mode 100644 index 0000000..45fc6ef --- /dev/null +++ b/src/components/atoms/AtomHeroText.vue @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/src/components/molecules/MoleculeDataTable.vue b/src/components/molecules/MoleculeDataTable.vue index 2b38571..37f7f93 100644 --- a/src/components/molecules/MoleculeDataTable.vue +++ b/src/components/molecules/MoleculeDataTable.vue @@ -32,12 +32,13 @@ > - + diff --git a/src/components/services/bank.service.ts b/src/components/services/bank.service.ts index 22cb318..03d9400 100644 --- a/src/components/services/bank.service.ts +++ b/src/components/services/bank.service.ts @@ -16,6 +16,9 @@ export const BankService = { async getAccountDetails(accountNumber: string): Promise { const database = new Databases(sdk, DATABASE_ID); const account = await AccountService.getAccount(accountNumber); + if(!account) { + throw new Error('Account not found'); + } const transactionDocuments = await database.listDocuments( TRANSACTIONS_COLLECTION_ID, [Query.equal('accountNumber', accountNumber)], 100, 0, undefined, undefined, ['$createdAt'], ['DESC']); return { diff --git a/src/components/views/BankView.vue b/src/components/views/BankView.vue index a9a4932..63261c8 100644 --- a/src/components/views/BankView.vue +++ b/src/components/views/BankView.vue @@ -12,13 +12,17 @@ :transactions="accountDetails.transactions" /> -
+
+ + Bitte Karte scannen... +
+
+ + Fehler: Der Account wurde nicht gefunden. +
+
+