You've already forked email-api-client
refactor: streamline response handling by introducing readResponseBody utility
All checks were successful
🚀 Publish Release Package / publish (push) Successful in 22s
All checks were successful
🚀 Publish Release Package / publish (push) Successful in 22s
This commit is contained in:
@@ -30,8 +30,7 @@ func (client *Client) SendEmail(request *EmailRequest) (*EmailCreateResponse, er
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response := Response[EmailCreateResponse]{}
|
||||
err = json.NewDecoder(resp.Body).Decode(&response)
|
||||
response, err := readResponseBody[Response[EmailCreateResponse]](resp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user