summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/api.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-01-08 22:14:00 +0100
committertechknowlogick <techknowlogick@gitea.io>2020-01-08 16:14:00 -0500
commit14a96874442a13bb212affb13a585f0536d89c2a (patch)
treef5406f59da2da0c70ca0d4efa3af3343b02debbb /routers/api/v1/api.go
parentf8dcc5f9f8e389218f1908ad9d5fe2044102abf1 (diff)
downloadgitea-14a96874442a13bb212affb13a585f0536d89c2a.tar.gz
gitea-14a96874442a13bb212affb13a585f0536d89c2a.zip
times Add filters (#9373)
(extend #9200) * add query param for GET functions (created Bevore & after) * add test * generalize func GetQueryBeforeSince Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r--routers/api/v1/api.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index 3f766c7a74..9f18951893 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -654,7 +654,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Group("/times", func() {
m.Combo("").Get(repo.ListTrackedTimesByRepository)
m.Combo("/:timetrackingusername").Get(repo.ListTrackedTimesByUser)
- }, mustEnableIssues)
+ }, mustEnableIssues, reqToken())
m.Group("/issues", func() {
m.Combo("").Get(repo.ListIssues).
Post(reqToken(), mustNotBeArchived, bind(api.CreateIssueOption{}), repo.CreateIssue)
@@ -688,12 +688,12 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Delete("/:id", reqToken(), repo.DeleteIssueLabel)
})
m.Group("/times", func() {
- m.Combo("", reqToken()).
+ m.Combo("").
Get(repo.ListTrackedTimes).
Post(bind(api.AddTimeOption{}), repo.AddTime).
Delete(repo.ResetIssueTime)
- m.Delete("/:id", reqToken(), repo.DeleteTime)
- })
+ m.Delete("/:id", repo.DeleteTime)
+ }, reqToken())
m.Combo("/deadline").Post(reqToken(), bind(api.EditDeadlineOption{}), repo.UpdateIssueDeadline)
m.Group("/stopwatch", func() {
m.Post("/start", reqToken(), repo.StartIssueStopwatch)