diff options
author | Unknwon <u@gogs.io> | 2015-12-17 02:28:47 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-12-17 02:28:47 -0500 |
commit | 9cd16c5b12d093dd694e146d6c845ee4c405c774 (patch) | |
tree | d9f1a037ba8ecbc3e5fe2f15f0baec6dec6242b4 /routers/api/v1/api.go | |
parent | 6673dcb0380aa99da25b4d1d68cf129635fe30d9 (diff) | |
download | gitea-9cd16c5b12d093dd694e146d6c845ee4c405c774.tar.gz gitea-9cd16c5b12d093dd694e146d6c845ee4c405c774.zip |
#1692 add organization APIs
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r-- | routers/api/v1/api.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index eeba713945..bc7c14006e 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -17,6 +17,7 @@ import ( "github.com/gogits/gogs/modules/middleware" "github.com/gogits/gogs/routers/api/v1/admin" "github.com/gogits/gogs/routers/api/v1/misc" + "github.com/gogits/gogs/routers/api/v1/org" "github.com/gogits/gogs/routers/api/v1/repo" "github.com/gogits/gogs/routers/api/v1/user" ) @@ -179,6 +180,11 @@ func RegisterRoutes(m *macaron.Macaron) { }, RepoAssignment()) }, ReqToken()) + // Organizations + m.Get("/user/orgs", org.ListMyOrgs) + m.Get("/users/:username/orgs", org.ListUserOrgs) + m.Combo("/orgs/:orgname").Get(org.Get).Patch(bind(api.EditOrgOption{}), org.Edit) + m.Any("/*", func(ctx *middleware.Context) { ctx.Error(404) }) @@ -191,6 +197,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Combo("").Patch(bind(api.EditUserOption{}), admin.EditUser). Delete(admin.DeleteUser) m.Post("/keys", admin.CreatePublicKey) + m.Post("/orgs", bind(api.CreateOrgOption{}), admin.CreateOrg) }) }) }, ReqAdmin()) |