aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/customer/service.go
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2025-10-11 17:53:59 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2025-10-11 17:53:59 +0530
commita8ce35aa10c0b61458aaee8820f8c937708f1133 (patch)
treec12a3b2aecd82729d1777299a563c46ab8ba61c6 /customer/service.go
parent37fec5e9e7ef24c4f682bf5103b9d0bd6769ce8b (diff)
properly deleting shipping addresses on customer editv0.14.0
Diffstat (limited to 'customer/service.go')
-rw-r--r--customer/service.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/customer/service.go b/customer/service.go
index 77b4dfa..8cd2bde 100644
--- a/customer/service.go
+++ b/customer/service.go
@@ -53,6 +53,7 @@ func getCustomers(customers *[]Customer, userId uint) error {
}
func (c *Customer) upsert() error {
+ db.Model(&c).Association("ShippingAddresses").Replace(c.ShippingAddresses)
res := db.Session(&gorm.Session{FullSaveAssociations: true}).Save(&c)
// TODO: handle potential errors
return res.Error