Skip to content

Commit b8e2361

Browse files
update path param for post summaries
1 parent f3064b3 commit b8e2361

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/handlers/post.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ func (h *PostHandler) ListAllPosts(c *gin.Context) {
264264
// @Failure 500 {object} models.ErrorResponse
265265
// @Router /posts/summaries [get]
266266
func (h *PostHandler) ListPostSummaries(c *gin.Context) {
267-
clubIDParam := c.Param("id")
267+
clubIDParam := c.Param("club_id")
268268
clubID, err := strconv.ParseUint(clubIDParam, 10, 32)
269269
if err != nil {
270270
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid club ID"})

internal/handlers/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (s *Server) setupRoutes() {
128128

129129
api.GET("/posts/:id/likes", postHandler.ListLikesByPostID)
130130
api.GET("/posts", postHandler.ListAllPosts)
131-
api.GET("/posts/:id/summaries", postHandler.ListPostSummaries)
131+
api.GET("/posts/:club_id/summaries", postHandler.ListPostSummaries)
132132
api.GET("/posts/:id", postHandler.GetPostByID)
133133

134134
api.GET("/posts/:id/comments", commentHandler.ListCommentsByPostID)

0 commit comments

Comments
 (0)