1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-05-11 05:55:29 +00:00

Merge endpoints for pull diff/patch (#17104)

this merges the two API endpoints for the PR diff/patch in to one
This commit is contained in:
qwerty287
2021-09-22 01:04:53 +02:00
committed by GitHub
parent 10108b184e
commit 0fa153f421
3 changed files with 50 additions and 109 deletions

View File

@ -897,8 +897,7 @@ func Routes(sessioner func(http.Handler) http.Handler) *web.Route {
m.Group("/{index}", func() {
m.Combo("").Get(repo.GetPullRequest).
Patch(reqToken(), bind(api.EditPullRequestOption{}), repo.EditPullRequest)
m.Get(".diff", repo.DownloadPullDiff)
m.Get(".patch", repo.DownloadPullPatch)
m.Get(".{diffType:diff|patch}", repo.DownloadPullDiffOrPatch)
m.Post("/update", reqToken(), repo.UpdatePullRequest)
m.Get("/commits", repo.GetPullRequestCommits)
m.Combo("/merge").Get(repo.IsPullRequestMerged).