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 | |
parent | 9b43fb9988e53a579fd9dffbdc890b0817f575c2 (diff) |
renamed customer.ShippingAddresses to customer.ShippingAddressv0.17.2
-rw-r--r-- | customer/customer.go | 2 | ||||
-rw-r--r-- | customer/service.go | 4 | ||||
-rw-r--r-- | main.go | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/customer/customer.go b/customer/customer.go index 25c4645..521c531 100644 --- a/customer/customer.go +++ b/customer/customer.go @@ -51,5 +51,5 @@ type Customer struct { Email string Website string BillingAddress CustomerBillingAddress - ShippingAddresses CustomerShippingAddress + ShippingAddress CustomerShippingAddress } 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 @@ -38,7 +38,7 @@ import ( "log" ) -const OPENBILLS_VERSION = "v0.17.1" +const OPENBILLS_VERSION = "v0.17.2" func init() { if !viper.GetBool("debug_mode") { |