🐛 Trying fix cannot edit tags & categories after published

This commit is contained in:
LittleSheep 2025-01-08 22:30:51 +08:00
parent 19e1b5f7c6
commit 62d09717bb

View File

@ -479,6 +479,9 @@ func EditPost(item models.Post) (models.Post, error) {
return item, err return item, err
} }
database.C.Model(&item).Association("Categories").Replace(item.Categories)
database.C.Model(&item).Association("Tags").Replace(item.Tags)
err = database.C.Save(&item).Error err = database.C.Save(&item).Error
return item, err return item, err