new endpoints, budget adjustment

This commit is contained in:
Gabe Farrell 2023-04-11 22:41:39 -04:00
parent cc36b80e72
commit c4047a36cc
9 changed files with 276 additions and 20 deletions

View file

@ -41,7 +41,7 @@ func GetMonthExpenses(w http.ResponseWriter, r *http.Request) {
if user.Expenses[i].Timestamp < time.Now().Add(-30*24*time.Hour).Unix() {
break
}
total = money.Add(total, user.Expenses[i].Amount)
total = money.Add(user.Expenses[i].Amount, total)
}
ret, err := json.Marshal(total)