Get the count of the all system users at endpoint /users/stats (#8847)
* Get the count of the all system users at endpoint /users/stats * Added GetTotalUsersStats test in api4 * Changed pluralization and added the test back.
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
c8d9595833
Коммит
e09b3c566b
11
app/user.go
11
app/user.go
@@ -1392,6 +1392,17 @@ func (a *App) GetVerifyEmailToken(token string) (*model.Token, *model.AppError)
|
||||
}
|
||||
}
|
||||
|
||||
func (a *App) GetTotalUsersStats() (*model.UsersStats, *model.AppError) {
|
||||
stats := &model.UsersStats{}
|
||||
|
||||
if result := <-a.Srv.Store.User().GetTotalUsersCount(); result.Err != nil {
|
||||
return nil, result.Err
|
||||
} else {
|
||||
stats.TotalUsersCount = result.Data.(int64)
|
||||
}
|
||||
return stats, nil
|
||||
}
|
||||
|
||||
func (a *App) VerifyUserEmail(userId string) *model.AppError {
|
||||
return (<-a.Srv.Store.User().VerifyEmail(userId)).Err
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user