Implement endpoint for APIv4: GET /users/{user_id}/audits (#5472)

Этот коммит содержится в:
Saturnino Abril
2017-02-21 21:07:57 +09:00
коммит произвёл George Goldberg
родитель 7068307a1c
Коммит 5c19d9be7f
7 изменённых файлов: 113 добавлений и 47 удалений

Просмотреть файл

@@ -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