diff options
author | blueworrybear <blueworrybear@gmail.com> | 2019-10-15 20:19:32 +0800 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-10-15 13:19:32 +0100 |
commit | 8c909820a9fd1697bb690ec0451c4ead97b51505 (patch) | |
tree | bda76eca8361237fbd5bc59bda58b278a516ffd6 /routers/routes | |
parent | d7d348ea86bd8066aeb079ad121120095d5cba4d (diff) | |
download | gitea-8c909820a9fd1697bb690ec0451c4ead97b51505.tar.gz gitea-8c909820a9fd1697bb690ec0451c4ead97b51505.zip |
Enable Uploading/Removing Attachments When Editing an Issue/Comment (#8426)
Diffstat (limited to 'routers/routes')
-rw-r--r-- | routers/routes/routes.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 0db0af43f0..9572ea8039 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -513,8 +513,9 @@ func RegisterRoutes(m *macaron.Macaron) { }) }, ignSignIn) - m.Group("", func() { - m.Post("/attachments", repo.UploadAttachment) + m.Group("/attachments", func() { + m.Post("", repo.UploadAttachment) + m.Post("/delete", repo.DeleteAttachment) }, reqSignIn) m.Group("/:username", func() { @@ -710,6 +711,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Post("/reactions/:action", bindIgnErr(auth.ReactionForm{}), repo.ChangeIssueReaction) m.Post("/lock", reqRepoIssueWriter, bindIgnErr(auth.IssueLockForm{}), repo.LockIssue) m.Post("/unlock", reqRepoIssueWriter, repo.UnlockIssue) + m.Get("/attachments", repo.GetIssueAttachments) }, context.RepoMustNotBeArchived()) m.Post("/labels", reqRepoIssuesOrPullsWriter, repo.UpdateIssueLabel) @@ -721,6 +723,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Post("", repo.UpdateCommentContent) m.Post("/delete", repo.DeleteComment) m.Post("/reactions/:action", bindIgnErr(auth.ReactionForm{}), repo.ChangeCommentReaction) + m.Get("/attachments", repo.GetCommentAttachments) }, context.RepoMustNotBeArchived()) m.Group("/labels", func() { m.Post("/new", bindIgnErr(auth.CreateLabelForm{}), repo.NewLabel) |