Implement endpoint for APIv4: GET /users/{user_id}/audits (#5472)
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
7068307a1c
Коммит
5c19d9be7f
10
app/audit.go
10
app/audit.go
@@ -8,7 +8,15 @@ import (
|
||||
)
|
||||
|
||||
func GetAudits(userId string, limit int) (model.Audits, *model.AppError) {
|
||||
if result := <-Srv.Store.Audit().Get(userId, limit); result.Err != nil {
|
||||
if result := <-Srv.Store.Audit().Get(userId, 0, limit); result.Err != nil {
|
||||
return nil, result.Err
|
||||
} else {
|
||||
return result.Data.(model.Audits), nil
|
||||
}
|
||||
}
|
||||
|
||||
func GetAuditsPage(userId string, page int, perPage int) (model.Audits, *model.AppError) {
|
||||
if result := <-Srv.Store.Audit().Get(userId, page*perPage, perPage); result.Err != nil {
|
||||
return nil, result.Err
|
||||
} else {
|
||||
return result.Data.(model.Audits), nil
|
||||
|
||||
Ссылка в новой задаче
Block a user