Remove dashboard API
This commit is contained in:
parent
06361c9066
commit
324e86bbf0
@ -1,25 +0,0 @@
|
|||||||
package server
|
|
||||||
|
|
||||||
import (
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"git.javil.eu/jacob1123/budgeteer/postgres"
|
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (h *Handler) dashboard(c *gin.Context) {
|
|
||||||
userID := MustGetToken(c).GetID()
|
|
||||||
budgets, err := h.Service.GetBudgetsForUser(c.Request.Context(), userID)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
d := DashboardData{
|
|
||||||
Budgets: budgets,
|
|
||||||
}
|
|
||||||
c.JSON(http.StatusOK, d)
|
|
||||||
}
|
|
||||||
|
|
||||||
type DashboardData struct {
|
|
||||||
Budgets []postgres.Budget
|
|
||||||
}
|
|
@ -54,7 +54,6 @@ func (h *Handler) LoadRoutes(router *gin.Engine) {
|
|||||||
|
|
||||||
authenticated := api.Group("")
|
authenticated := api.Group("")
|
||||||
authenticated.Use(h.verifyLoginWithForbidden)
|
authenticated.Use(h.verifyLoginWithForbidden)
|
||||||
authenticated.GET("/dashboard", h.dashboard)
|
|
||||||
authenticated.GET("/account/:accountid/transactions", h.transactionsForAccount)
|
authenticated.GET("/account/:accountid/transactions", h.transactionsForAccount)
|
||||||
authenticated.POST("/account/:accountid/reconcile", h.reconcileTransactions)
|
authenticated.POST("/account/:accountid/reconcile", h.reconcileTransactions)
|
||||||
authenticated.POST("/account/:accountid", h.editAccount)
|
authenticated.POST("/account/:accountid", h.editAccount)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user