diff --git a/backend/src/middleware/club.go b/backend/src/middleware/club.go index 7d99b76b2..c64fa7068 100644 --- a/backend/src/middleware/club.go +++ b/backend/src/middleware/club.go @@ -12,7 +12,7 @@ import ( ) func (m *MiddlewareService) ClubAuthorizeById(c *fiber.Ctx) error { - clubUUID, err := utilities.ValidateID(c.Params("id")) + clubUUID, err := utilities.ValidateID(c.Params("clubID")) if err != nil { return errors.FailedToValidateID.FiberError(c) } diff --git a/backend/src/middleware/user.go b/backend/src/middleware/user.go index d431907cd..308372a4f 100644 --- a/backend/src/middleware/user.go +++ b/backend/src/middleware/user.go @@ -9,7 +9,7 @@ import ( ) func (m *MiddlewareService) UserAuthorizeById(c *fiber.Ctx) error { - idAsUUID, err := utilities.ValidateID(c.Params("id")) + idAsUUID, err := utilities.ValidateID(c.Params("userID")) if err != nil { return errors.FailedToValidateID.FiberError(c) } diff --git a/backend/src/server/routes/club.go b/backend/src/server/routes/club.go index 89b42191f..91d2e440a 100644 --- a/backend/src/server/routes/club.go +++ b/backend/src/server/routes/club.go @@ -16,8 +16,8 @@ func Club(router fiber.Router, clubService services.ClubServiceInterface, middle clubs.Get("/", middlewareService.Authorize(types.ClubReadAll), clubController.GetAllClubs) clubs.Post("/", clubController.CreateClub) - // api/v1/clubs/:id/* - clubsID := clubs.Group("/:id") + // api/v1/clubs/:clubID/* + clubsID := clubs.Group("/:clubID") clubsID.Use(middleware.SuperSkipper(middlewareService.UserAuthorizeById)) clubsID.Get("/", clubController.GetClub) diff --git a/backend/src/services/club.go b/backend/src/services/club.go index d12710a76..c05610c1f 100644 --- a/backend/src/services/club.go +++ b/backend/src/services/club.go @@ -1,8 +1,6 @@ package services import ( - "fmt" - "github.com/GenerateNU/sac/backend/src/errors" "github.com/GenerateNU/sac/backend/src/models" "github.com/GenerateNU/sac/backend/src/transactions" @@ -47,7 +45,6 @@ func (c *ClubService) GetClubs(limit string, page string) ([]models.Club, *error func (c *ClubService) CreateClub(clubBody models.CreateClubRequestBody) (*models.Club, *errors.Error) { if err := c.Validate.Struct(clubBody); err != nil { - fmt.Print(err) return nil, &errors.FailedToValidateClub } diff --git a/backend/src/services/user.go b/backend/src/services/user.go index 82f4c431b..a940a6b33 100644 --- a/backend/src/services/user.go +++ b/backend/src/services/user.go @@ -1,7 +1,6 @@ package services import ( - "fmt" "strings" "github.com/GenerateNU/sac/backend/src/auth" @@ -92,8 +91,6 @@ func (u *UserService) UpdateUser(id string, userBody models.UpdateUserRequestBod return nil, &errors.FailedToMapRequestToModel } - fmt.Println(user) - return transactions.UpdateUser(u.DB, *idAsUUID, *user) }