Skip to content

Commit 795913e

Browse files
wolfogrelunnylafriks
authored
Load GitRepo in API before deleting issue (#21720) (#21795)
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>
1 parent e609ef9 commit 795913e

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
@@ -890,7 +890,7 @@ func Routes() *web.Route {
890890
m.Group("/{index}", func() {
891891
m.Combo("").Get(repo.GetIssue).
892892
Patch(reqToken(), bind(api.EditIssueOption{}), repo.EditIssue).
893-
Delete(reqToken(), reqAdmin(), repo.DeleteIssue)
893+
Delete(reqToken(), reqAdmin(), context.ReferencesGitRepo(), repo.DeleteIssue)
894894
m.Group("/comments", func() {
895895
m.Combo("").Get(repo.ListIssueComments).
896896
Post(reqToken(), mustNotBeArchived, bind(api.CreateIssueCommentOption{}), repo.CreateIssueComment)

0 commit comments

Comments
 (0)