修复无法删除空dashboard问题 (#889)

This commit is contained in:
zheng 2022-03-17 19:07:24 +08:00 committed by GitHub
parent 7ec6d84c7d
commit 46c60a32fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -74,7 +74,12 @@ func (d *Dashboard) Del() error {
}
if len(cgids) == 0 {
return nil
return DB().Transaction(func(tx *gorm.DB) error {
if err := tx.Where("id=?", d.Id).Delete(&Dashboard{}).Error; err != nil {
return err
}
return nil
})
}
return DB().Transaction(func(tx *gorm.DB) error {