summaryrefslogtreecommitdiffstats
path: root/routers/api/v1
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2018-10-18 09:44:51 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2018-10-18 16:44:51 +0800
commitdd62ca7ba9b49e799a8bea896cff1b209f813b7e (patch)
tree6d3ff7da203b6548195ddd37c205c5d5ba7453dc /routers/api/v1
parent7bb4d610e5cca7ad514e377d2b36254a4cfee5b9 (diff)
downloadgitea-dd62ca7ba9b49e799a8bea896cff1b209f813b7e.tar.gz
gitea-dd62ca7ba9b49e799a8bea896cff1b209f813b7e.zip
Add support for search by uid (#4876)
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers/api/v1')
-rw-r--r--routers/api/v1/user/user.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/api/v1/user/user.go b/routers/api/v1/user/user.go
index edd5d1b1cb..38576a7337 100644
--- a/routers/api/v1/user/user.go
+++ b/routers/api/v1/user/user.go
@@ -27,6 +27,10 @@ func Search(ctx *context.APIContext) {
// in: query
// description: keyword
// type: string
+ // - name: uid
+ // in: query
+ // description: ID of the user to search for
+ // type: integer
// - name: limit
// in: query
// description: maximum number of users to return
@@ -45,6 +49,7 @@ func Search(ctx *context.APIContext) {
// "$ref": "#/definitions/User"
opts := &models.SearchUserOptions{
Keyword: strings.Trim(ctx.Query("q"), " "),
+ UID: com.StrTo(ctx.Query("uid")).MustInt64(),
Type: models.UserTypeIndividual,
PageSize: com.StrTo(ctx.Query("limit")).MustInt(),
}