From 324e86bbf0775f658f40c29412fdaa32b5a3294c Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Wed, 6 Apr 2022 19:51:20 +0000 Subject: [PATCH] Remove dashboard API --- server/dashboard.go | 25 ------------------------- server/http.go | 1 - 2 files changed, 26 deletions(-) delete mode 100644 server/dashboard.go diff --git a/server/dashboard.go b/server/dashboard.go deleted file mode 100644 index 64667d8..0000000 --- a/server/dashboard.go +++ /dev/null @@ -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 -} diff --git a/server/http.go b/server/http.go index 46f994d..c691291 100644 --- a/server/http.go +++ b/server/http.go @@ -54,7 +54,6 @@ func (h *Handler) LoadRoutes(router *gin.Engine) { authenticated := api.Group("") authenticated.Use(h.verifyLoginWithForbidden) - authenticated.GET("/dashboard", h.dashboard) authenticated.GET("/account/:accountid/transactions", h.transactionsForAccount) authenticated.POST("/account/:accountid/reconcile", h.reconcileTransactions) authenticated.POST("/account/:accountid", h.editAccount)