diff options
author | Ethan Koenig <etk39@cornell.edu> | 2016-12-23 20:53:11 -0500 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2016-12-24 09:53:11 +0800 |
commit | 8a4161c72335900407b8f111027ad9ed53c0b631 (patch) | |
tree | ddbb149b5f78d5a3ebf91db1a079ac4be3cc064b /routers/api/v1/api.go | |
parent | 25b5ffb6af390eac8d4a76c134379fd1ae88a423 (diff) | |
download | gitea-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.go | 9 |
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) |