diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2025-10-11 20:59:08 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2025-10-11 20:59:08 +0530 |
commit | 99aee928a64649be75c4698b8e856e3ea05bc695 (patch) | |
tree | 82ae701e75935560e1c69cc2b329d4262987ffcc /customer/service.go | |
parent | 9b43fb9988e53a579fd9dffbdc890b0817f575c2 (diff) |
renamed customer.ShippingAddresses to customer.ShippingAddressv0.17.2
Diffstat (limited to 'customer/service.go')
-rw-r--r-- | customer/service.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/customer/service.go b/customer/service.go index a0ed4dc..ca401f1 100644 --- a/customer/service.go +++ b/customer/service.go @@ -23,7 +23,7 @@ import ( ) func getCustomer(customer *Customer, id uint) error { - res := db.Preload("BillingAddress").Preload("ShippingAddresses").Find(&customer, id) + res := db.Preload("BillingAddress").Preload("ShippingAddress").Find(&customer, id) // TODO: handle potential errors if res.Error != nil { @@ -53,7 +53,7 @@ func getCustomers(customers *[]Customer) error { } func (c *Customer) upsert() error { - db.Model(&c).Association("ShippingAddresses").Replace(c.ShippingAddresses) + db.Model(&c).Association("ShippingAddress").Replace(c.ShippingAddress) res := db.Session(&gorm.Session{FullSaveAssociations: true}).Save(&c) // TODO: handle potential errors return res.Error |