diff options
author | qwerty287 <80460567+qwerty287@users.noreply.github.com> | 2021-09-22 01:04:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-22 01:04:53 +0200 |
commit | 0fa153f4219bc6a447891f30f4dbc60bf180ee4c (patch) | |
tree | 638eb74e1624f289f749073438fa33328c7184ac /routers/api/v1/api.go | |
parent | 10108b184efe28da85bbbc7efef24a79ccbd3cd0 (diff) | |
download | gitea-0fa153f4219bc6a447891f30f4dbc60bf180ee4c.tar.gz gitea-0fa153f4219bc6a447891f30f4dbc60bf180ee4c.zip |
Merge endpoints for pull diff/patch (#17104)
this merges the two API endpoints for the PR diff/patch in to one
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r-- | routers/api/v1/api.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 90189701c0..082381d31c 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -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). |