diff options
Diffstat (limited to 'routers/api/v1/user/user.go')
-rw-r--r-- | routers/api/v1/user/user.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/routers/api/v1/user/user.go b/routers/api/v1/user/user.go index 8c57b1f099..bba7b7a5d1 100644 --- a/routers/api/v1/user/user.go +++ b/routers/api/v1/user/user.go @@ -9,6 +9,7 @@ import ( "net/http" "code.gitea.io/gitea/models" + user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/convert" "code.gitea.io/gitea/routers/api/v1/utils" @@ -54,11 +55,11 @@ func Search(ctx *context.APIContext) { listOptions := utils.GetListOptions(ctx) - users, maxResults, err := models.SearchUsers(&models.SearchUserOptions{ + users, maxResults, err := user_model.SearchUsers(&user_model.SearchUserOptions{ Actor: ctx.User, Keyword: ctx.FormTrim("q"), UID: ctx.FormInt64("uid"), - Type: models.UserTypeIndividual, + Type: user_model.UserTypeIndividual, ListOptions: listOptions, }) if err != nil { @@ -105,7 +106,7 @@ func GetInfo(ctx *context.APIContext) { if !models.IsUserVisibleToViewer(u, ctx.User) { // fake ErrUserNotExist error message to not leak information about existence - ctx.NotFound("GetUserByName", models.ErrUserNotExist{Name: ctx.Params(":username")}) + ctx.NotFound("GetUserByName", user_model.ErrUserNotExist{Name: ctx.Params(":username")}) return } ctx.JSON(http.StatusOK, convert.ToUser(u, ctx.User)) |