Pass the filename from CWS on to the client (#16203)
Этот коммит содержится в:
@@ -7,7 +7,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"time"
|
||||
@@ -303,14 +302,14 @@ func getSubscriptionInvoicePDF(c *Context, w http.ResponseWriter, r *http.Reques
|
||||
return
|
||||
}
|
||||
|
||||
pdfData, appErr := c.App.Cloud().GetInvoicePDF(c.Params.InvoiceId)
|
||||
pdfData, filename, appErr := c.App.Cloud().GetInvoicePDF(c.Params.InvoiceId)
|
||||
if appErr != nil {
|
||||
c.Err = model.NewAppError("Api4.getSuscriptionInvoicePDF", "api.cloud.request_error", nil, appErr.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
err := writeFileResponse(
|
||||
fmt.Sprintf("%s.pdf", c.Params.InvoiceId),
|
||||
filename,
|
||||
"application/pdf",
|
||||
int64(binary.Size(pdfData)),
|
||||
time.Now(),
|
||||
|
||||
@@ -19,5 +19,5 @@ type CloudInterface interface {
|
||||
|
||||
GetSubscription() (*model.Subscription, *model.AppError)
|
||||
GetInvoicesForSubscription() ([]*model.Invoice, *model.AppError)
|
||||
GetInvoicePDF(invoiceID string) ([]byte, *model.AppError)
|
||||
GetInvoicePDF(invoiceID string) ([]byte, string, *model.AppError)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user