[MM-19640] Retrieve Compliance files from the System Console (#14976)
* add query param for downloading file * Address PR comments * sanitize error messages * revert error santization * address PR comments * Log Error * Comment for clarification * Add test + Opt In Option * Fix typo * Remove line number * Check is downloadable in server * Don't use constants * Check for downloadExportResults in API * make actiance export zip * make i18n strings * Remove translations * Add translations * Revert "Add translations" This reverts commit adc5d28b3e7712f51cd3eff565e30fb8ddfd6f65. Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
77f7a97bee
Коммит
935ddaa251
@@ -4698,6 +4698,21 @@ func (c *Client4) CancelJob(jobId string) (bool, *Response) {
|
||||
return CheckStatusOK(r), BuildResponse(r)
|
||||
}
|
||||
|
||||
// DownloadJob downloads the results of the job
|
||||
func (c *Client4) DownloadJob(jobId string) ([]byte, *Response) {
|
||||
r, appErr := c.DoApiGet(c.GetJobsRoute()+fmt.Sprintf("/%v/download", jobId), "")
|
||||
if appErr != nil {
|
||||
return nil, BuildErrorResponse(r, appErr)
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
data, err := ioutil.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
return nil, BuildErrorResponse(r, NewAppError("GetFile", "model.client.read_job_result_file.app_error", nil, err.Error(), r.StatusCode))
|
||||
}
|
||||
return data, BuildResponse(r)
|
||||
}
|
||||
|
||||
// Roles Section
|
||||
|
||||
// GetRole gets a single role by ID.
|
||||
|
||||
Ссылка в новой задаче
Block a user