summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/api.go
diff options
context:
space:
mode:
authorDavid Svantesson <davidsvantesson@gmail.com>2019-10-01 07:32:28 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2019-10-01 13:32:28 +0800
commit36bcd4cd6b6d1131e3f812a825558fbfe5dcca20 (patch)
tree1606d302648ca6f2f6633d21aeb5d06a568b14d8 /routers/api/v1/api.go
parentd3bc3dd4d16aef053699d5bfc45039db060d373e (diff)
downloadgitea-36bcd4cd6b6d1131e3f812a825558fbfe5dcca20.tar.gz
gitea-36bcd4cd6b6d1131e3f812a825558fbfe5dcca20.zip
API endpoint for searching teams. (#8108)
* Api endpoint for searching teams. Signed-off-by: dasv <david.svantesson@qrtech.se> * Move API to /orgs/:org/teams/search Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Regenerate swagger Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix search is Get Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add test for search team API. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Update routers/api/v1/org/team.go grammar Co-Authored-By: Richard Mahn <richmahn@users.noreply.github.com> * Fix review comments Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix some issues in repo collaboration team search, after changes in this PR. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Remove teamUser which is not used and replace with actual user id. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Remove unused search variable UserIsAdmin. * Add paging to team search. * Re-genereate swagger Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix review comments Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * fix * Regenerate swagger
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r--routers/api/v1/api.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index c57edf6a99..04ff91fbbf 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -802,8 +802,11 @@ func RegisterRoutes(m *macaron.Macaron) {
Put(reqToken(), reqOrgMembership(), org.PublicizeMember).
Delete(reqToken(), reqOrgMembership(), org.ConcealMember)
})
- m.Combo("/teams", reqToken(), reqOrgMembership()).Get(org.ListTeams).
- Post(reqOrgOwnership(), bind(api.CreateTeamOption{}), org.CreateTeam)
+ m.Group("/teams", func() {
+ m.Combo("", reqToken()).Get(org.ListTeams).
+ Post(reqOrgOwnership(), bind(api.CreateTeamOption{}), org.CreateTeam)
+ m.Get("/search", org.SearchTeam)
+ }, reqOrgMembership())
m.Group("/hooks", func() {
m.Combo("").Get(org.ListHooks).
Post(bind(api.CreateHookOption{}), org.CreateHook)