Handle entering multiple weights in a single day

The graph would otherwise use I believe the first entry?
Now we use the average.
This commit is contained in:
Brandon Presley 2023-10-26 21:11:56 +13:00
parent 39b87ba932
commit 32da68e905
1 changed files with 1 additions and 1 deletions

View File

@ -28,8 +28,8 @@ export default function ViewWeightGraph() {
weightRepo
.createQueryBuilder()
.select("STRFTIME('%Y-%m-%d', created)", "created")
.addSelect("AVG(value) as value")
.addSelect("unit")
.addSelect("value")
.where("DATE(created) >= DATE('now', 'weekday 0', :difference)", {
difference,
})