diff options
Diffstat (limited to 'customer/hooks.go')
| -rw-r--r-- | customer/hooks.go | 16 | 
1 files changed, 1 insertions, 15 deletions
diff --git a/customer/hooks.go b/customer/hooks.go index 148004f..7f715c3 100644 --- a/customer/hooks.go +++ b/customer/hooks.go @@ -1,5 +1,5 @@  /* openbills - Server for web based Libre Billing Software - * Copyright (C) 2023  Vidhu Kant Sharma <vidhukant@vidhukant.com> + * Copyright (C) 2023-2025  Vidhu Kant Sharma <vidhukant@vidhukant.com>   *   * This program is free software: you can redistribute it and/or modify   * it under the terms of the GNU General Public License as published by @@ -39,19 +39,5 @@ func (c *Customer) BeforeDelete(tx *gorm.DB) error {  		return errors.ErrNoWhereCondition  	} -	var err error - -	// delete billing address -	err = db.Where("customer_id = ?", c.ID).Delete(&CustomerBillingAddress{}).Error -	if err != nil { -		return err -	} - -	// delete shipping address -	err = db.Where("customer_id = ?", c.ID).Delete(&CustomerShippingAddress{}).Error -	if err != nil { -		return err -	} -  	return nil  }  |