diff --git a/pkg/server/posts_api.go b/pkg/server/posts_api.go index 6b43744..5759d2d 100644 --- a/pkg/server/posts_api.go +++ b/pkg/server/posts_api.go @@ -13,12 +13,12 @@ import ( ) func getPost(c *fiber.Ctx) error { - id, _ := c.ParamsInt("postId", 0) + id := c.Params("postId") take := c.QueryInt("take", 0) offset := c.QueryInt("offset", 0) tx := database.C.Where(&models.Post{ - BaseModel: models.BaseModel{ID: uint(id)}, + Alias: id, }) post, err := services.GetPost(tx) diff --git a/pkg/view/src/components/PostItem.tsx b/pkg/view/src/components/PostItem.tsx index ea6a7c3..c49fd9f 100644 --- a/pkg/view/src/components/PostItem.tsx +++ b/pkg/view/src/components/PostItem.tsx @@ -69,7 +69,7 @@ export default function PostItem(props: {