diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-09-03 23:39:05 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-09-03 23:39:05 +0530 |
commit | cba9f19ba50c60576a5961e89c24caefca52d740 (patch) | |
tree | 5dd36d4903c640e11a022c5fbf0e55adc3cdd5a5 /item | |
parent | 46083ff15e16b0b49132af9466bcab7c2ae71322 (diff) |
deleting addresses upon customer deletionv0.0.5
Diffstat (limited to 'item')
-rw-r--r-- | item/hooks.go | 5 |
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 } |