Additional API support for labels (#3290)
* Add API support for labels. * Error handling for adding/replacing multiple issue labels * Revisions to function names and error handling. Use issue.ClearLabels in replace/clear functions * Additional code cleanup
This commit is contained in:
parent
b1133c9934
commit
2eeb0ec9b0
5 changed files with 399 additions and 1 deletions
|
@ -241,7 +241,23 @@ func RegisterRoutes(m *macaron.Macaron) {
|
|||
})
|
||||
m.Group("/issues", func() {
|
||||
m.Combo("").Get(repo.ListIssues).Post(bind(api.CreateIssueOption{}), repo.CreateIssue)
|
||||
m.Combo("/:index").Get(repo.GetIssue).Patch(bind(api.EditIssueOption{}), repo.EditIssue)
|
||||
m.Group("/:index", func() {
|
||||
m.Combo("").Get(repo.GetIssue).Patch(bind(api.EditIssueOption{}), repo.EditIssue)
|
||||
m.Group("/labels", func() {
|
||||
m.Combo("").Get(repo.GetIssueLabels).
|
||||
Post(bind(api.IssueLabelsOption{}), repo.AddIssueLabels).
|
||||
Put(bind(api.IssueLabelsOption{}), repo.ReplaceIssueLabels).
|
||||
Delete(repo.ClearIssueLabels)
|
||||
m.Delete("/:id", repo.DeleteIssueLabel)
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
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).
|
||||
Delete(repo.DeleteLabel)
|
||||
})
|
||||
}, RepoAssignment())
|
||||
}, ReqToken())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue