mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
API Endpoint for watching (#191)
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user