-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finished follower endpoints #142
Conversation
Co-authored-by: Mai Nguyen <[email protected]>
bdcafb4
to
aff5bb7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nits
} | ||
|
||
func (cf *ClubFollowerController) GetUserFollowingClubs(c *fiber.Ctx) error { | ||
clubs, err := cf.clubFollowerService.GetUserFollowingClubs(c.Params("userID")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this value changes for everyone, we should standardize this value, especially as the middleware just checks for "id' @garrettladley @zacklassetter @in-mai-space
} | ||
|
||
func (uf *UserFollowerController) CreateFollowing(c *fiber.Ctx) error { | ||
err := uf.userFollowerService.CreateFollowing(c.Params("userID"), c.Params("clubID")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
@@ -48,7 +48,7 @@ type User struct { | |||
|
|||
Tag []Tag `gorm:"many2many:user_tags;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"-" validate:"-"` | |||
Member []Club `gorm:"many2many:user_club_members;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"-" validate:"-"` | |||
Follower []Club `gorm:"many2many:user_club_followers;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"-" validate:"-"` | |||
Follower []Club `gorm:"many2many:user_club_followers;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"clubs_followed,omitempty" validate:"-"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to send a list of followers? or should it only be passed when requested? might be unnecessary information
backend/src/server/server.go
Outdated
@@ -119,6 +135,17 @@ func clubRoutes(router fiber.Router, clubService services.ClubServiceInterface, | |||
clubsID.Get("/", clubController.GetClub) | |||
clubsID.Patch("/", middlewareService.Authorize(types.ClubWrite), clubController.UpdateClub) | |||
clubsID.Delete("/", middlewareService.Authorize(types.ClubDelete), clubController.DeleteClub) | |||
clubs.Get("/:id", clubController.GetClub) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why define these endpoints?
} | ||
|
||
// Get all following for a user | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return &errors.ClubNotFound | ||
} | ||
// What to return here? | ||
// Should we return User or Success message? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return nil
Description
SAC-26
Please include a summary of the changes and the related issue. Please also
include relevant motivation, context, and images!
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. If they are unit
tests, provide the file name the tests are in. If they are not unit tests,
describe how you tested the change.
We manually tested all of the endpoints and wrote unit tests
Checklist