Additional API support for milestones (#3383)

This commit is contained in:
lstahlman 2016-08-24 15:18:56 -07:00 committed by 无闻
parent 06602a84ff
commit 84b56c3c53
3 changed files with 238 additions and 0 deletions

View file

@ -259,6 +259,11 @@ func RegisterRoutes(m *macaron.Macaron) {
Delete(repo.ClearIssueLabels)
m.Delete("/:id", repo.DeleteIssueLabel)
})
m.Group("/milestone", func() {
m.Combo("").Get(repo.GetIssueMilestone).
Post(bind(api.SetIssueMilestoneOption{}), repo.SetIssueMilestone).
Delete(repo.DeleteIssueMilestone)
})
})
}, mustEnableIssues)
@ -268,6 +273,13 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Combo("/:id").Get(repo.GetLabel).Patch(bind(api.EditLabelOption{}), repo.EditLabel).
Delete(repo.DeleteLabel)
})
m.Group("/milestones", func() {
m.Combo("").Get(repo.ListMilestones).
Post(bind(api.CreateMilestoneOption{}), repo.CreateMilestone)
m.Combo("/:id").Get(repo.GetMilestone).Patch(bind(api.EditMilestoneOption{}), repo.EditMilestone).
Delete(repo.DeleteMilestone)
m.Post("/:id/:action", repo.ChangeMilestoneStatus)
})
}, repoAssignment())
}, reqToken())