feat(comments): 支持编辑与管理可见历史,采纳展示改用楼层号
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -442,5 +442,10 @@ func (s *ModerationService) PurgeComment(actor *Actor, id uint) error {
|
||||
if !cm.DeletedAt.Valid {
|
||||
return ErrContentNotDeleted
|
||||
}
|
||||
return s.db.Unscoped().Delete(&model.Comment{}, id).Error
|
||||
return s.db.Transaction(func(tx *gorm.DB) error {
|
||||
if err := tx.Where("comment_id = ?", id).Delete(&model.CommentEditHistory{}).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
return tx.Unscoped().Delete(&model.Comment{}, id).Error
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user