MM-23038: Compliance Report Fixes (#14242)
* add warning count as return value * add warning count as return value * fix file name * update mock * add setting warning to db * replace wrongly removed string * add dummy function to see if it will build * remove dummy function Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
bdd0e9febb
Коммит
1031e27fd8
@@ -5,6 +5,7 @@ package commands
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
@@ -161,11 +162,15 @@ func buildExportCmdF(format string) func(command *cobra.Command, args []string)
|
||||
return errors.New("message export feature not available")
|
||||
}
|
||||
|
||||
err2 := a.MessageExport().RunExport(format, startTime)
|
||||
if err2 != nil {
|
||||
return err2
|
||||
warningsCount, appErr := a.MessageExport().RunExport(format, startTime)
|
||||
if appErr != nil {
|
||||
return appErr
|
||||
}
|
||||
if warningsCount == 0 {
|
||||
CommandPrettyPrintln("SUCCESS: Your data was exported.")
|
||||
} else {
|
||||
CommandPrettyPrintln(fmt.Sprintf("WARNING: %d warnings encountered, see warning.txt for details.", warningsCount))
|
||||
}
|
||||
CommandPrettyPrintln("SUCCESS: Your data was exported.")
|
||||
|
||||
auditRec := a.MakeAuditRecord("buildExport", audit.Success)
|
||||
auditRec.AddMeta("format", format)
|
||||
|
||||
Ссылка в новой задаче
Block a user