[MM-56616] Changes for the DM for batch reporting (#26019)
* [MM-56616] Changes for the DM for batch reporting * Use requesting user's locale * Fix lint * Remove unnecessary test * Move back to file attachment * Add default API case * Fix i18n * Hardcode the CSV string
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d3be94f2b9
Коммит
435da9bea7
@@ -18,7 +18,7 @@ import (
|
||||
type BatchReportWorkerAppIFace interface {
|
||||
SaveReportChunk(format string, prefix string, count int, reportData []model.ReportableObject) *model.AppError
|
||||
CompileReportChunks(format string, prefix string, numberOfChunks int, headers []string) *model.AppError
|
||||
SendReportToUser(rctx request.CTX, userID string, jobId string, format string) *model.AppError
|
||||
SendReportToUser(rctx request.CTX, job *model.Job, format string) *model.AppError
|
||||
CleanupReportChunks(format string, prefix string, numberOfChunks int) *model.AppError
|
||||
}
|
||||
|
||||
@@ -113,10 +113,6 @@ func (worker *BatchReportWorker) processChunk(job *model.Job, reportData []model
|
||||
}
|
||||
|
||||
func (worker *BatchReportWorker) complete(rctx request.CTX, job *model.Job) error {
|
||||
requestingUserId := job.Data["requesting_user_id"]
|
||||
if requestingUserId == "" {
|
||||
return errors.New("No user to send the report to")
|
||||
}
|
||||
fileCount, err := getFileCount(job.Data)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -131,7 +127,7 @@ func (worker *BatchReportWorker) complete(rctx request.CTX, job *model.Job) erro
|
||||
worker.app.CleanupReportChunks(worker.reportFormat, job.Id, fileCount)
|
||||
}()
|
||||
|
||||
if appErr = worker.app.SendReportToUser(rctx, requestingUserId, job.Id, worker.reportFormat); appErr != nil {
|
||||
if appErr = worker.app.SendReportToUser(rctx, job, worker.reportFormat); appErr != nil {
|
||||
return appErr
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user