Skip to content

Commit ac409fc

Browse files
wolfogrelunnylafriks
authored
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>
1 parent df512f7 commit ac409fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/api/v1/api.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ func Routes(ctx gocontext.Context) *web.Route {
898898
m.Group("/{index}", func() {
899899
m.Combo("").Get(repo.GetIssue).
900900
Patch(reqToken(), bind(api.EditIssueOption{}), repo.EditIssue).
901-
Delete(reqToken(), reqAdmin(), repo.DeleteIssue)
901+
Delete(reqToken(), reqAdmin(), context.ReferencesGitRepo(), repo.DeleteIssue)
902902
m.Group("/comments", func() {
903903
m.Combo("").Get(repo.ListIssueComments).
904904
Post(reqToken(), mustNotBeArchived, bind(api.CreateIssueCommentOption{}), repo.CreateIssueComment)

0 commit comments

Comments
 (0)