diff options
author | Jason Song <i@wolfogre.com> | 2022-11-13 13:54:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-13 00:54:24 -0500 |
commit | ac409fcfba4071a0d6868e628338b175345be2ae (patch) | |
tree | d30a7e673c91bb32951e40df382a524d58165e3e | |
parent | df512f77b7b6fac3efdda265a3ab9bb95a952d69 (diff) | |
download | gitea-ac409fcfba4071a0d6868e628338b175345be2ae.tar.gz gitea-ac409fcfba4071a0d6868e628338b175345be2ae.zip |
Load GitRepo in API before deleting issue (#21720) (#21796)
Backport #21720.
Fix #20921.
The `ctx.Repo.GitRepo` has been used in deleting issues when the issue
is a PR.
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
-rw-r--r-- | routers/api/v1/api.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 0d11674aa9..a515551a57 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -898,7 +898,7 @@ func Routes(ctx gocontext.Context) *web.Route { m.Group("/{index}", func() { m.Combo("").Get(repo.GetIssue). Patch(reqToken(), bind(api.EditIssueOption{}), repo.EditIssue). - Delete(reqToken(), reqAdmin(), repo.DeleteIssue) + Delete(reqToken(), reqAdmin(), context.ReferencesGitRepo(), repo.DeleteIssue) m.Group("/comments", func() { m.Combo("").Get(repo.ListIssueComments). Post(reqToken(), mustNotBeArchived, bind(api.CreateIssueCommentOption{}), repo.CreateIssueComment) |