summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/api.go
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2016-12-23 20:53:11 -0500
committerLunny Xiao <xiaolunwen@gmail.com>2016-12-24 09:53:11 +0800
commit8a4161c72335900407b8f111027ad9ed53c0b631 (patch)
treeddbb149b5f78d5a3ebf91db1a079ac4be3cc064b /routers/api/v1/api.go
parent25b5ffb6af390eac8d4a76c134379fd1ae88a423 (diff)
downloadgitea-8a4161c72335900407b8f111027ad9ed53c0b631.tar.gz
gitea-8a4161c72335900407b8f111027ad9ed53c0b631.zip
API Endpoint for watching (#191)
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r--routers/api/v1/api.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index 9943b97f78..11adfa5c5f 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -209,6 +209,8 @@ func RegisterRoutes(m *macaron.Macaron) {
})
m.Get("/starred", user.GetStarredRepos)
+
+ m.Get("/subscriptions", user.GetWatchedRepos)
})
}, reqToken())
@@ -239,6 +241,8 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Delete("", user.Unstar)
}, context.ExtractOwnerAndRepo())
})
+
+ m.Get("/subscriptions", user.GetMyWatchedRepos)
}, reqToken())
// Repositories
@@ -316,6 +320,11 @@ func RegisterRoutes(m *macaron.Macaron) {
Patch(reqRepoWriter(), bind(api.EditMilestoneOption{}), repo.EditMilestone).
Delete(reqRepoWriter(), repo.DeleteMilestone)
})
+ m.Group("/subscription", func() {
+ m.Get("", user.IsWatching)
+ m.Put("", user.Watch)
+ m.Delete("", user.Unwatch)
+ }, context.ExtractOwnerAndRepo())
m.Get("/editorconfig/:filename", context.RepoRef(), repo.GetEditorconfig)
m.Group("/pulls", func() {
m.Combo("").Get(bind(api.ListPullRequestsOptions{}), repo.ListPullRequests).Post(reqRepoWriter(), bind(api.CreatePullRequestOption{}), repo.CreatePullRequest)