Changeable permalink

This commit is contained in:
2024-02-10 12:05:34 +08:00
parent a223c85ed1
commit 4dbbb423e7
3 changed files with 27 additions and 4 deletions

View File

@ -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)