🐛 Bug fixes on query statement

This commit is contained in:
2024-11-02 23:47:44 +08:00
parent 553a87ab78
commit f9a01bff70
8 changed files with 12 additions and 10 deletions

View File

@ -25,7 +25,7 @@ func listPostReplies(c *fiber.Ctx) error {
if err := database.C.Where("name = ?", c.Query("author")).First(&author).Error; err != nil {
return fiber.NewError(fiber.StatusNotFound, err.Error())
}
tx = tx.Where("author_id = ?", author.ID)
tx = tx.Where("publisher_id = ?", author.ID)
}
if len(c.Query("category")) > 0 {
@ -68,7 +68,7 @@ func listPostFeaturedReply(c *fiber.Ctx) error {
if err := database.C.Where("name = ?", c.Query("author")).First(&author).Error; err != nil {
return fiber.NewError(fiber.StatusNotFound, err.Error())
}
tx = tx.Where("author_id = ?", author.ID)
tx = tx.Where("publisher_id = ?", author.ID)
}
if len(c.Query("category")) > 0 {