api docs, minor changes

This commit is contained in:
Gabe Farrell 2023-04-10 23:04:20 -04:00
parent 4aa8a2f822
commit c249a077cc
3 changed files with 203 additions and 9 deletions

View file

@ -15,6 +15,7 @@ import (
)
type BudgetResponse struct {
Status int `json:"status"`
// total amount allowed to spend in a month
Budget money.Money `json:"budget"`
// total amount allowed to spend by category
@ -59,6 +60,8 @@ func GetBudget(w http.ResponseWriter, r *http.Request) {
response.Expenses[e.Category] = append(response.Expenses[e.Category], e)
}
response.Status = 200
ret, err := json.Marshal(response)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)