[API] Extend times API (#9200)

Extensively extend the times API.

close #8833; close #8513; close #8559
This commit is contained in:
6543 2019-12-27 21:30:58 +01:00 committed by zeripath
parent 0bcf644da4
commit f2d03cda96
19 changed files with 916 additions and 194 deletions

View file

@ -687,8 +687,11 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Delete("/:id", reqToken(), repo.DeleteIssueLabel)
})
m.Group("/times", func() {
m.Combo("").Get(repo.ListTrackedTimes).
Post(reqToken(), bind(api.AddTimeOption{}), repo.AddTime)
m.Combo("", reqToken()).
Get(repo.ListTrackedTimes).
Post(bind(api.AddTimeOption{}), repo.AddTime).
Delete(repo.ResetIssueTime)
m.Delete("/:id", reqToken(), repo.DeleteTime)
})
m.Combo("/deadline").Post(reqToken(), bind(api.EditDeadlineOption{}), repo.UpdateIssueDeadline)
m.Group("/stopwatch", func() {