summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r--routers/api/v1/api.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index 2842d78cd3..c57edf6a99 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -771,6 +771,14 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Delete("", bind(api.DeleteFileOptions{}), repo.DeleteFile)
}, reqRepoWriter(models.UnitTypeCode), reqToken())
}, reqRepoReader(models.UnitTypeCode))
+ m.Group("/topics", func() {
+ m.Combo("").Get(repo.ListTopics).
+ Put(reqToken(), reqAdmin(), bind(api.RepoTopicOptions{}), repo.UpdateTopics)
+ m.Group("/:topic", func() {
+ m.Combo("").Put(reqToken(), repo.AddTopic).
+ Delete(reqToken(), repo.DeleteTopic)
+ }, reqAdmin())
+ }, reqAnyRepoReader())
}, repoAssignment())
})