Skip to content

Commit 6ba8131

Browse files
committed
extract GET routes out of RepoMustNotBeArchived
1 parent cae5c8d commit 6ba8131

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

routers/routes/routes.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,9 +749,11 @@ func RegisterRoutes(m *macaron.Macaron) {
749749
m.Post("/reactions/:action", bindIgnErr(auth.ReactionForm{}), repo.ChangeIssueReaction)
750750
m.Post("/lock", reqRepoIssueWriter, bindIgnErr(auth.IssueLockForm{}), repo.LockIssue)
751751
m.Post("/unlock", reqRepoIssueWriter, repo.UnlockIssue)
752+
}, context.RepoMustNotBeArchived())
753+
m.Group("/:index", func() {
752754
m.Get("/attachments", repo.GetIssueAttachments)
753755
m.Get("/attachments/:uuid", repo.GetAttachment)
754-
}, context.RepoMustNotBeArchived())
756+
})
755757

756758
m.Post("/labels", reqRepoIssuesOrPullsWriter, repo.UpdateIssueLabel)
757759
m.Post("/milestone", reqRepoIssuesOrPullsWriter, repo.UpdateIssueMilestone)
@@ -767,8 +769,10 @@ func RegisterRoutes(m *macaron.Macaron) {
767769
m.Post("", repo.UpdateCommentContent)
768770
m.Post("/delete", repo.DeleteComment)
769771
m.Post("/reactions/:action", bindIgnErr(auth.ReactionForm{}), repo.ChangeCommentReaction)
770-
m.Get("/attachments", repo.GetCommentAttachments)
771772
}, context.RepoMustNotBeArchived())
773+
m.Group("/comments/:id", func() {
774+
m.Get("/attachments", repo.GetCommentAttachments)
775+
})
772776
m.Group("/labels", func() {
773777
m.Post("/new", bindIgnErr(auth.CreateLabelForm{}), repo.NewLabel)
774778
m.Post("/edit", bindIgnErr(auth.CreateLabelForm{}), repo.UpdateLabel)

0 commit comments

Comments
 (0)