From 7f8850398c21c3ce438b0c9cf4169432eef7fd69 Mon Sep 17 00:00:00 2001 From: maxerenberg <34190303+maxerenberg@users.noreply.github.com> Date: Wed, 27 Jan 2021 09:06:35 -0500 Subject: [PATCH] MM-32018 update URL endpoint for DownloadComplianceReport function (#16700) --- model/client4.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/model/client4.go b/model/client4.go index f5787f5b80..48216fb837 100644 --- a/model/client4.go +++ b/model/client4.go @@ -383,7 +383,11 @@ func (c *Client4) GetComplianceReportsRoute() string { } func (c *Client4) GetComplianceReportRoute(reportId string) string { - return fmt.Sprintf("/compliance/reports/%v", reportId) + return fmt.Sprintf("%s/%s", c.GetComplianceReportsRoute(), reportId) +} + +func (c *Client4) GetComplianceReportDownloadRoute(reportId string) string { + return fmt.Sprintf("%s/%s/download", c.GetComplianceReportsRoute(), reportId) } func (c *Client4) GetOutgoingWebhooksRoute() string { @@ -3873,7 +3877,7 @@ func (c *Client4) GetComplianceReport(reportId string) (*Compliance, *Response) // DownloadComplianceReport returns a full compliance report as a file. func (c *Client4) DownloadComplianceReport(reportId string) ([]byte, *Response) { - rq, err := http.NewRequest("GET", c.ApiUrl+c.GetComplianceReportRoute(reportId), nil) + rq, err := http.NewRequest("GET", c.ApiUrl+c.GetComplianceReportDownloadRoute(reportId), nil) if err != nil { return nil, &Response{Error: NewAppError("DownloadComplianceReport", "model.client.connecting.app_error", nil, err.Error(), http.StatusBadRequest)} }