aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server.js b/src/server.js
index c108a00..5d6cf9f 100644
--- a/src/server.js
+++ b/src/server.js
@@ -313,8 +313,8 @@ async function formatSummary(database, username) {
summary.week_avg = getBudgetAverage(summary.week)
- summary.categories = await database.query(`select category, sum(amount) as s from transactions where category <> '' group by category`, { type: database.QueryTypes.SELECT });
- summary.subcategories = await database.query(`select subcategory, sum(amount) as s from transactions where subcategory <> '' group by subcategory`, { type: database.QueryTypes.SELECT });
+ summary.categories = await database.query(`select category, sum(amount) as s from transactions where username = '${username}' and category <> '' group by category`, { type: database.QueryTypes.SELECT });
+ summary.subcategories = await database.query(`select subcategory, sum(amount) as s from transactions where username = '${username}' and subcategory <> '' group by subcategory`, { type: database.QueryTypes.SELECT });
summary.name = username
return summary
}