Skip to content

Commit

Permalink
Fixing return bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gowizzard committed Apr 28, 2021
1 parent 4f2bddc commit 3213185
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ func DownloadInvoicePDF(config DownloadInvoice) ([]byte, error) {
// New http request
request, err := http.NewRequest("GET", fmt.Sprintf("https://my.sevdesk.de/api/v1/Invoice/%s/getPdf?preventSendBy=%s&download=%s", config.ID, config.PreventSendBy, config.Download), nil)
if err != nil {
return "", err
return nil, err
}

// Set header
Expand All @@ -640,7 +640,7 @@ func DownloadInvoicePDF(config DownloadInvoice) ([]byte, error) {
// Response to sevDesk
response, err := client.Do(request)
if err != nil {
return "", err
return nil, err
}

// Close response
Expand All @@ -649,7 +649,7 @@ func DownloadInvoicePDF(config DownloadInvoice) ([]byte, error) {
// Read body data
read, err := io.ReadAll(response.Body)
if err != nil {
return "", err
return nil, err
}

// Return data
Expand Down

0 comments on commit 3213185

Please sign in to comment.