From 18aad2c225c2b3f8a34e158eff6b83a581b46763 Mon Sep 17 00:00:00 2001 From: qowevisa Date: Sat, 16 Nov 2024 11:43:32 +0200 Subject: [PATCH] Add routes to handlers for expense group --- cmd/http-server/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/http-server/main.go b/cmd/http-server/main.go index 66b9658..2b17f50 100644 --- a/cmd/http-server/main.go +++ b/cmd/http-server/main.go @@ -88,6 +88,14 @@ func main() { typesRoutes.PUT("/edit/:id", handlers.TypePutId) typesRoutes.DELETE("/delete/:id", handlers.TypeDeleteId) } + expensesRoutes := api.Group("/expense", middleware.AuthMiddleware()) + { + expensesRoutes.POST("/add", handlers.ExpenseAdd) + expensesRoutes.GET("/:id", handlers.ExpenseGetId) + expensesRoutes.GET("/all", handlers.ExpenseGetAll) + expensesRoutes.PUT("/edit/:id", handlers.ExpensePutId) + expensesRoutes.DELETE("/delete/:id", handlers.ExpenseDeleteId) + } } r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))