From 6b25d1b3b761881350c72920721112b86795f8e0 Mon Sep 17 00:00:00 2001 From: Jonas Kwiedor Date: Tue, 28 Mar 2023 10:40:59 +0200 Subject: [PATCH] fix: Change struct to slice. --- fulfillments.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/fulfillments.go b/fulfillments.go index 8c1e5e0..df40910 100644 --- a/fulfillments.go +++ b/fulfillments.go @@ -4,6 +4,8 @@ package goshopify import ( "encoding/json" + "fmt" + "io" "net/http" "time" ) @@ -14,10 +16,10 @@ type FulfillmentsBody struct { } type FulfillmentsBodyFulfillment struct { - Message string `json:"message"` - NotifyCustomer bool `json:"notify_customer"` - TrackingInfo FulfillmentsBodyTrackingInfo `json:"tracking_info"` - LineItemsByFulfillmentOrder FulfillmentsBodyLineItemsByFulfillmentOrder `json:"line_items_by_fulfillment_order"` + Message string `json:"message"` + NotifyCustomer bool `json:"notify_customer"` + TrackingInfo FulfillmentsBodyTrackingInfo `json:"tracking_info"` + LineItemsByFulfillmentOrder []FulfillmentsBodyLineItemsByFulfillmentOrder `json:"line_items_by_fulfillment_order"` } type FulfillmentsBodyTrackingInfo struct { @@ -138,6 +140,9 @@ func Fulfillments(body FulfillmentsBody, r Request) (FulfillmentsReturn, error) // Close request defer response.Body.Close() + read, _ := io.ReadAll(response.Body) + fmt.Println(string(read)) + // Decode data var decode FulfillmentsReturn