Feed no longer show replies

This commit is contained in:
2024-02-14 18:48:02 +08:00
parent 1baffd4200
commit b0c9368530
3 changed files with 27 additions and 13 deletions

View File

@ -77,11 +77,14 @@ func listPost(c *fiber.Ctx) error {
if len(c.Query("category")) > 0 {
tx = services.FilterPostWithCategory(tx, c.Query("category"))
}
if len(c.Query("tag")) > 0 {
tx = services.FilterPostWithTag(tx, c.Query("tag"))
}
if !c.QueryBool("reply", true) {
tx = tx.Where("reply_id IS NULL")
}
var count int64
if err := tx.
Model(&models.Post{}).