aboutsummaryrefslogtreecommitdiff
path: root/item/hooks.go
diff options
context:
space:
mode:
Diffstat (limited to 'item/hooks.go')
-rw-r--r--item/hooks.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/item/hooks.go b/item/hooks.go
index c7dc498..74b6860 100644
--- a/item/hooks.go
+++ b/item/hooks.go
@@ -60,7 +60,10 @@ func (b *Brand) BeforeDelete(tx *gorm.DB) error {
}
// delete all items
- db.Where("brand_id = ? and user_id = ?", b.ID, b.UserID).Delete(&SavedItem{})
+ err := db.Where("brand_id = ? and user_id = ?", b.ID, b.UserID).Delete(&SavedItem{}).Error
+ if err != nil {
+ return err
+ }
return nil
}