mirror of
https://github.com/gabehf/BudgetBuddy.git
synced 2026-03-13 01:10:39 -07:00
api for initial widgets
This commit is contained in:
parent
36f751a69f
commit
4aa8a2f822
14 changed files with 864 additions and 11 deletions
29
widgets/router.go
Normal file
29
widgets/router.go
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package widgets
|
||||
|
||||
import "github.com/go-chi/chi/v5"
|
||||
|
||||
func Router() *chi.Mux {
|
||||
r := chi.NewRouter()
|
||||
|
||||
// balance widget
|
||||
r.Get("/balance", GetBalance)
|
||||
r.Post("/balance", SetBalance)
|
||||
|
||||
// transaction widget
|
||||
r.Get("/transactions/recent", GetRecentTransactions)
|
||||
r.Post("/transactions", NewTransaction)
|
||||
r.Post("/transactions/recurring", NewRecurring)
|
||||
|
||||
// budget widget
|
||||
r.Get("/budget", GetBudget)
|
||||
r.Post("/budget", SetBudget)
|
||||
r.Post("/budget/categories", SetCategoryBudget)
|
||||
|
||||
// expenses
|
||||
r.Get("/expenses/month", GetMonthExpenses)
|
||||
|
||||
// income
|
||||
r.Get("/income/month", GetMonthIncome)
|
||||
|
||||
return r
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue