diff --git a/pkg/internal/server/api/index.go b/pkg/internal/server/api/index.go index f034bc4..50f2d30 100644 --- a/pkg/internal/server/api/index.go +++ b/pkg/internal/server/api/index.go @@ -35,7 +35,7 @@ func MapAPIs(app *fiber.App, baseURL string) { posts.Post("/:postId/react", reactPost) posts.Delete("/:postId", deletePost) - posts.Get("/:post/replies", listPostReplies) + posts.Get("/:postId/replies", listPostReplies) } api.Get("/categories", listCategories) diff --git a/pkg/internal/server/api/replies_api.go b/pkg/internal/server/api/replies_api.go index 0d3ef94..d5cc115 100644 --- a/pkg/internal/server/api/replies_api.go +++ b/pkg/internal/server/api/replies_api.go @@ -14,7 +14,7 @@ func listPostReplies(c *fiber.Ctx) error { tx := database.C var post models.Post - if err := database.C.Where("alias = ?", c.Params("post")).First(&post).Error; err != nil { + if err := database.C.Where("id = ?", c.Params("postId")).First(&post).Error; err != nil { return fiber.NewError(fiber.StatusBadRequest, fmt.Sprintf("unable to find post: %v", err)) } else { tx = services.FilterPostReply(tx, post.ID)