mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 14:44:35 -04:00
Provide diff and patch API endpoints (#11751)
* Provide diff and patch API endpoints The diff and patch endpoints on the main routes are not accessible by token therefore we provide new API based endpoints for these Fix #10923 Signed-off-by: Andrew Thornton <art27@cantab.net> * placate swagger Signed-off-by: Andrew Thornton <art27@cantab.net> * Make the response an actual string Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
parent
17f8de7a54
commit
f761a37a0f
4 changed files with 182 additions and 0 deletions
|
@ -796,6 +796,8 @@ func RegisterRoutes(m *macaron.Macaron) {
|
|||
m.Group("/:index", func() {
|
||||
m.Combo("").Get(repo.GetPullRequest).
|
||||
Patch(reqToken(), reqRepoWriter(models.UnitTypePullRequests), bind(api.EditPullRequestOption{}), repo.EditPullRequest)
|
||||
m.Get(".diff", repo.DownloadPullDiff)
|
||||
m.Get(".patch", repo.DownloadPullPatch)
|
||||
m.Combo("/merge").Get(repo.IsPullRequestMerged).
|
||||
Post(reqToken(), mustNotBeArchived, bind(auth.MergePullRequestForm{}), repo.MergePullRequest)
|
||||
m.Group("/reviews", func() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue