diff options
Diffstat (limited to 'customer/service.go')
-rw-r--r-- | customer/service.go | 1 |
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 |