forked from forgejo/forgejo
API Endpoint for watching (#191)
This commit is contained in:
parent
25b5ffb6af
commit
8a4161c723
3 changed files with 147 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue