Initial migration of the store to be sync (#10592)
* Migrating audit store * Final migration example for the audit store * async example * Ending migration * Removing Async helper * Fixing tests * Fixing govet problems with the StoreResult instanstiation
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
957ec1388b
Коммит
12c50eb830
12
app/audit.go
12
app/audit.go
@@ -8,17 +8,9 @@ import (
|
||||
)
|
||||
|
||||
func (a *App) GetAudits(userId string, limit int) (model.Audits, *model.AppError) {
|
||||
result := <-a.Srv.Store.Audit().Get(userId, 0, limit)
|
||||
if result.Err != nil {
|
||||
return nil, result.Err
|
||||
}
|
||||
return result.Data.(model.Audits), nil
|
||||
return a.Srv.Store.Audit().Get(userId, 0, limit)
|
||||
}
|
||||
|
||||
func (a *App) GetAuditsPage(userId string, page int, perPage int) (model.Audits, *model.AppError) {
|
||||
result := <-a.Srv.Store.Audit().Get(userId, page*perPage, perPage)
|
||||
if result.Err != nil {
|
||||
return nil, result.Err
|
||||
}
|
||||
return result.Data.(model.Audits), nil
|
||||
return a.Srv.Store.Audit().Get(userId, page*perPage, perPage)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user