修复无法删除空dashboard问题 (#889)
This commit is contained in:
parent
7ec6d84c7d
commit
46c60a32fd
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue