Skip to content

Commit

Permalink
Load GitRepo in API before deleting issue (go-gitea#21720)
Browse files Browse the repository at this point in the history
Fix go-gitea#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>
  • Loading branch information
3 people committed Nov 13, 2022
1 parent e4bf9ca commit 6055c77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/api/v1/api.go
Expand Up @@ -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)
Expand Down

0 comments on commit 6055c77

Please sign in to comment.