refactor/serializing #1

Merged
mats merged 4 commits from refactor/serializing into main 2024-11-08 23:02:12 +01:00
Showing only changes of commit dfcdf0939f - Show all commits

View File

@@ -59,14 +59,14 @@ func getItemData(sku string) (*messages.AddItem, error) {
priceField, ok := item.GetFields()[4] priceField, ok := item.GetFields()[4]
if ok { if ok {
pricef, ok := priceField.(float64) priceFloat, ok := priceField.(float64)
if !ok { if !ok {
price, ok = priceField.(int) price, ok = priceField.(int)
if !ok { if !ok {
return nil, fmt.Errorf("invalid price type") return nil, fmt.Errorf("invalid price type")
} }
} else { } else {
price = int(pricef) price = int(priceFloat)
} }
} }
} }