diff options
author | 6543 <6543@obermui.de> | 2021-02-01 22:57:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-01 22:57:12 +0100 |
commit | 6d27703f143b5f295f0ceff96fe6d98f5c8c5514 (patch) | |
tree | 6f4916b7c62c78a66e4b3ef6b274e4f958285b95 /routers/api/v1/api.go | |
parent | a9188631b90da523d92866796341be8fdc77281c (diff) | |
download | gitea-6d27703f143b5f295f0ceff96fe6d98f5c8c5514.tar.gz gitea-6d27703f143b5f295f0ceff96fe6d98f5c8c5514.zip |
[API] List, Check, Add & delete endpoints for repository teams (#13630)
* List, Check, Add & delete endpoints for repository teams
* return units on single team responce too
* Add Tests
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r-- | routers/api/v1/api.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index b78c55269e..42b52db936 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -727,6 +727,12 @@ func Routes() *web.Route { Put(reqAdmin(), bind(api.AddCollaboratorOption{}), repo.AddCollaborator). Delete(reqAdmin(), repo.DeleteCollaborator) }, reqToken()) + m.Group("/teams", func() { + m.Get("", reqAnyRepoReader(), repo.ListTeams) + m.Combo("/{team}").Get(reqAnyRepoReader(), repo.IsTeam). + Put(reqAdmin(), repo.AddTeam). + Delete(reqAdmin(), repo.DeleteTeam) + }, reqToken()) m.Get("/raw/*", context.RepoRefForAPI, reqRepoReader(models.UnitTypeCode), repo.GetRawFile) m.Get("/archive/*", reqRepoReader(models.UnitTypeCode), repo.GetArchive) m.Combo("/forks").Get(repo.ListForks). |