#3290 better code structure and batch minor improvements

This commit is contained in:
Unknwon 2016-08-03 11:51:22 -07:00
parent 2eeb0ec9b0
commit e7fd65f0cf
10 changed files with 196 additions and 228 deletions

View file

@ -244,7 +244,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Group("/:index", func() {
m.Combo("").Get(repo.GetIssue).Patch(bind(api.EditIssueOption{}), repo.EditIssue)
m.Group("/labels", func() {
m.Combo("").Get(repo.GetIssueLabels).
m.Combo("").Get(repo.ListIssueLabels).
Post(bind(api.IssueLabelsOption{}), repo.AddIssueLabels).
Put(bind(api.IssueLabelsOption{}), repo.ReplaceIssueLabels).
Delete(repo.ClearIssueLabels)
@ -255,8 +255,8 @@ func RegisterRoutes(m *macaron.Macaron) {
})
m.Group("/labels", func() {
m.Combo("").Get(repo.ListLabels).
Post(bind(api.LabelOption{}), repo.CreateLabel)
m.Combo("/:id").Get(repo.GetLabel).Patch(bind(api.LabelOption{}), repo.EditLabel).
Post(bind(api.CreateLabelOption{}), repo.CreateLabel)
m.Combo("/:id").Get(repo.GetLabel).Patch(bind(api.EditLabelOption{}), repo.EditLabel).
Delete(repo.DeleteLabel)
})
}, RepoAssignment())