Implement compliance endpoints for APIv4 (#5683)
* Implement compliance endpoints for APIv4 * Add paging to get reports endpoint
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
a284cd8c18
Коммит
3ebfb36953
@@ -11,12 +11,12 @@ import (
|
||||
"github.com/mattermost/platform/utils"
|
||||
)
|
||||
|
||||
func GetComplianceReports() (model.Compliances, *model.AppError) {
|
||||
func GetComplianceReports(page, perPage int) (model.Compliances, *model.AppError) {
|
||||
if !*utils.Cfg.ComplianceSettings.Enable || !utils.IsLicensed || !*utils.License.Features.Compliance {
|
||||
return nil, model.NewLocAppError("GetComplianceReports", "ent.compliance.licence_disable.app_error", nil, "")
|
||||
}
|
||||
|
||||
if result := <-Srv.Store.Compliance().GetAll(); result.Err != nil {
|
||||
if result := <-Srv.Store.Compliance().GetAll(page*perPage, perPage); result.Err != nil {
|
||||
return nil, result.Err
|
||||
} else {
|
||||
return result.Data.(model.Compliances), nil
|
||||
|
||||
Ссылка в новой задаче
Block a user