Remove dashboard API

This commit is contained in:
Jan Bader 2022-04-06 19:51:20 +00:00
parent 06361c9066
commit 324e86bbf0
2 changed files with 0 additions and 26 deletions

View File

@ -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
}

View File

@ -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)