From e108ff259c597e14bf4cd66793251f568c3fe409 Mon Sep 17 00:00:00 2001 From: forevermatt Date: Thu, 19 Nov 2020 20:12:43 -0500 Subject: [PATCH 1/4] Enable viewing account details and renaming the account --- README.md | 2 +- src/data/transactions.js | 6 ++++++ src/views/AccountView.svelte | 38 ++++++++++++++++++++++++++++++++++++ src/views/Accounts.svelte | 10 +++++----- src/views/routes.js | 2 ++ 5 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 src/views/AccountView.svelte diff --git a/README.md b/README.md index 9407cc2..b38c157 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ https://forevermatt.github.io/svelte-budget/ - [x] Edit a category - [x] Add a financial account - [x] Add nicer buttons (with icons) -- [ ] Edit a financial account +- [x] Edit a financial account - [x] Record an expense - [x] Create separate repo to document data structure versions - [x] Subtract the transaction amount from a category's budget upon completion diff --git a/src/data/transactions.js b/src/data/transactions.js index 36db8ea..9ad098b 100644 --- a/src/data/transactions.js +++ b/src/data/transactions.js @@ -14,6 +14,12 @@ export const startNewPendingTransaction = transactionData => { transactionInProgress.set(transaction) } +export const getTransactionsForAccount = accountUuid => { + return get(transactions).filter(transaction => { + return transaction.accountUuid === accountUuid + }) +} + export const getTransactionsForCategory = categoryUuid => { return get(transactions).filter(transaction => { const categoryAmounts = transaction.categoryAmounts || {} diff --git a/src/views/AccountView.svelte b/src/views/AccountView.svelte new file mode 100644 index 0000000..9c0a5e0 --- /dev/null +++ b/src/views/AccountView.svelte @@ -0,0 +1,38 @@ + + + + +

+ { account.name }: +

+
+ + + +