mirror of
https://github.com/gabehf/BudgetBuddy.git
synced 2026-03-15 18:26:01 -07:00
api docs, minor changes
This commit is contained in:
parent
4aa8a2f822
commit
c249a077cc
3 changed files with 203 additions and 9 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue