Skip to content

Commit

Permalink
Fix get customer to always return http response
Browse files Browse the repository at this point in the history
  • Loading branch information
dmorejon committed May 24, 2022
1 parent 8b8ca12 commit 138adb9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions customers/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ func (c *Client) Get(customerID string) (*GetResponse, error) {
}

if err != nil {
return nil, err
return response, err
}

var customer Customer
err = json.Unmarshal(resp.ResponseBody, &customer)

if resp.StatusCode == http.StatusNoContent {
return nil, err
return response, err
}

var customer Customer
err = json.Unmarshal(resp.ResponseBody, &customer)

response.Customer = &customer

return response, err
Expand Down

0 comments on commit 138adb9

Please sign in to comment.