jalaj711 / gastos-backend

Backend for Gastos - A finance tracker with multiple wallet support, custom color coded labels, complex search filters and spend insights.
Other
1 stars 0 forks source link

Put zero values in statistic endpoints instead of non-existent value #2

Closed jalaj711 closed 1 year ago

jalaj711 commented 1 year ago

Currently, when you access the stat endpoints (label.get_stats, wallet.get_stats and user.get_stats), it will simply omit the values for which no value exists.

For example:

"weekly":[{"week":1,"count":4,"spent":160},{"week":2,"count":8,"spent":788}]

...which leads to graphs like these: Screenshot from 2022-12-13 00-12-06

However, it should include all the values even if they are zero. The data from API should be like:

"weekly":[{"week":1,"count":4,"spent":160},{"week":2,"count":8,"spent":788},{"week":3,"count":0,"spent":0},{"week":4,"count":0,"spent":0}]
jalaj711 commented 1 year ago

Fixed in 9c6bbfae09b973a57ee194e65393534a4680c900.

Graphs are better now. :) Screenshot from 2022-12-14 13-48-56