Question APIs

This commit is contained in:
2025-02-07 19:25:55 +08:00
parent 9d9b2ac866
commit 57b908e5a0
5 changed files with 333 additions and 2 deletions

View File

@@ -142,6 +142,7 @@ func editArticle(c *fiber.Ctx) error {
if err := database.C.Where(models.Post{
BaseModel: cruda.BaseModel{ID: uint(id)},
PublisherID: publisher.ID,
Type: models.PostTypeArticle,
}).Preload("Publisher").First(&item).Error; err != nil {
return fiber.NewError(fiber.StatusNotFound, err.Error())
}