diff --git a/README.md b/README.md index ed3a924..434e085 100644 --- a/README.md +++ b/README.md @@ -15,4 +15,5 @@ https://forevermatt.github.io/svelte-budget/ - [x] Add a financial account - [ ] Edit a financial account - [ ] Record an expense +- [ ] Create separate repo to document data structure versions - [ ] ... diff --git a/src/data/budget.js b/src/data/budget.js index ab93cf3..0b35bcb 100644 --- a/src/data/budget.js +++ b/src/data/budget.js @@ -17,6 +17,11 @@ const addCategoryToBudget = (categoryUuid, budgeted) => { }) } +export const getBudgetedFor = uuid => { + let budgetCategory = get(budgetStore)[uuid] || {} + return budgetCategory.budgeted || 0 +} + const isExistingCategory = uuid => get(budgetStore).hasOwnProperty(uuid) export const loadBudget = () => { diff --git a/src/views/CategoryAmount.svelte b/src/views/CategoryAmount.svelte index d4b0b5b..4903b3b 100644 --- a/src/views/CategoryAmount.svelte +++ b/src/views/CategoryAmount.svelte @@ -1,6 +1,6 @@