From 57b247767d8b1516afb1bb5bae7a77cb049cfc8e Mon Sep 17 00:00:00 2001 From: Annika Date: Wed, 13 Jul 2022 15:58:16 -0600 Subject: [PATCH] can now create new categories --- budgit.client/src/components/Category.vue | 3 +++ budgit.client/src/pages/OverviewPage.vue | 21 ++++++++++++++++--- budgit.client/src/pages/TransactionsPage.vue | 2 +- .../src/services/CategoriesService.js | 5 +++++ 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/budgit.client/src/components/Category.vue b/budgit.client/src/components/Category.vue index f8352ed..7913009 100644 --- a/budgit.client/src/components/Category.vue +++ b/budgit.client/src/components/Category.vue @@ -23,6 +23,9 @@ export default { return { totalSpent() { let total = 0; + if (!props.category.transactions) { + return 0 + } for (let t = 0; t < props.category.transactions.length; t++) { total += props.category.transactions[t].amount } diff --git a/budgit.client/src/pages/OverviewPage.vue b/budgit.client/src/pages/OverviewPage.vue index 193d7be..1fd3a23 100644 --- a/budgit.client/src/pages/OverviewPage.vue +++ b/budgit.client/src/pages/OverviewPage.vue @@ -1,7 +1,14 @@