Skip to content

Commit

Permalink
resolved go issue + updated go version
Browse files Browse the repository at this point in the history
  • Loading branch information
DOOduneye committed Feb 9, 2024
1 parent d4842fc commit c45d191
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion backend/go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 2 additions & 3 deletions backend/src/server/routes/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion backend/src/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit c45d191

Please sign in to comment.