Skip to content

Commit

Permalink
ghwf ci fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettladley committed Feb 5, 2024
1 parent 943735c commit 664d07b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion backend/src/middleware/club.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion backend/src/middleware/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions backend/src/server/routes/club.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions backend/src/services/club.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
}

Expand Down
3 changes: 0 additions & 3 deletions backend/src/services/user.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package services

import (
"fmt"
"strings"

"github.com/GenerateNU/sac/backend/src/auth"
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 664d07b

Please sign in to comment.