From c45d191019d53038e3eda37a7eed2c979ef82734 Mon Sep 17 00:00:00 2001 From: David Oduneye Date: Fri, 9 Feb 2024 14:19:02 -0500 Subject: [PATCH] resolved go issue + updated go version --- backend/go.mod | 2 +- backend/src/server/routes/user.go | 5 ++--- backend/src/server/server.go | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/go.mod b/backend/go.mod index d2a794a4d..cecc317a1 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -1,6 +1,6 @@ module github.com/GenerateNU/sac/backend -go 1.21.6 +go 1.22.0 require ( github.com/garrettladley/mattress v0.2.2 diff --git a/backend/src/server/routes/user.go b/backend/src/server/routes/user.go index 2926e875c..1b1cdde9b 100644 --- a/backend/src/server/routes/user.go +++ b/backend/src/server/routes/user.go @@ -4,7 +4,6 @@ import ( "github.com/GenerateNU/sac/backend/src/controllers" "github.com/GenerateNU/sac/backend/src/middleware" "github.com/GenerateNU/sac/backend/src/services" - "github.com/GenerateNU/sac/backend/src/types" "github.com/gofiber/fiber/v2" ) @@ -14,11 +13,11 @@ func User(router fiber.Router, userService services.UserServiceInterface, middle // api/v1/users/* users := router.Group("/users") users.Post("/", userController.CreateUser) - users.Get("/", middleware.SuperSkipper(middlewareService.Authorize(types.UserReadAll)), userController.GetUsers) + users.Get("/", userController.GetUsers) // api/v1/users/:userID/* usersID := users.Group("/:userID") - usersID.Use(middleware.SuperSkipper(middlewareService.UserAuthorizeById)) + usersID.Use(middlewareService.UserAuthorizeById) usersID.Get("/", userController.GetUser) usersID.Patch("/", userController.UpdateUser) diff --git a/backend/src/server/server.go b/backend/src/server/server.go index 5d249a0a3..7de1ea3bf 100644 --- a/backend/src/server/server.go +++ b/backend/src/server/server.go @@ -34,7 +34,7 @@ func Init(db *gorm.DB, settings config.Settings) *fiber.App { middlewareService := middleware.NewMiddlewareService(db, validate, settings.Auth) apiv1 := app.Group("/api/v1") - apiv1.Use(middlewareService.Authenticate) + // apiv1.Use(middlewareService.Authenticate) routes.Utility(app)