diff --git a/src/models/dashboard.go b/src/models/dashboard.go index 98f6964a..45f47874 100644 --- a/src/models/dashboard.go +++ b/src/models/dashboard.go @@ -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 {