aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/issue_tracked_time.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-08-11 17:08:52 +0200
committerGitHub <noreply@github.com>2021-08-11 18:08:52 +0300
commitf1a810e0901b80eb6bc21103434fc0737af17eaa (patch)
tree9656d780cf19fd745f41eef0012701458aa271c4 /routers/api/v1/repo/issue_tracked_time.go
parent2d25b7d44bedf8f17cc2b49f39d1cee662b199a5 (diff)
downloadgitea-f1a810e0901b80eb6bc21103434fc0737af17eaa.tar.gz
gitea-f1a810e0901b80eb6bc21103434fc0737af17eaa.zip
Related refactors to ctx.FormX functions (#16567)
* use FormTrim if posible * speedup goGet * only convert if nessesary
Diffstat (limited to 'routers/api/v1/repo/issue_tracked_time.go')
-rw-r--r--routers/api/v1/repo/issue_tracked_time.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/routers/api/v1/repo/issue_tracked_time.go b/routers/api/v1/repo/issue_tracked_time.go
index e2935fd13d..b27b746eb2 100644
--- a/routers/api/v1/repo/issue_tracked_time.go
+++ b/routers/api/v1/repo/issue_tracked_time.go
@@ -7,7 +7,6 @@ package repo
import (
"fmt"
"net/http"
- "strings"
"time"
"code.gitea.io/gitea/models"
@@ -90,7 +89,7 @@ func ListTrackedTimes(ctx *context.APIContext) {
IssueID: issue.ID,
}
- qUser := strings.Trim(ctx.FormString("user"), " ")
+ qUser := ctx.FormTrim("user")
if qUser != "" {
user, err := models.GetUserByName(qUser)
if models.IsErrUserNotExist(err) {
@@ -500,7 +499,7 @@ func ListTrackedTimesByRepository(ctx *context.APIContext) {
}
// Filters
- qUser := strings.Trim(ctx.FormString("user"), " ")
+ qUser := ctx.FormTrim("user")
if qUser != "" {
user, err := models.GetUserByName(qUser)
if models.IsErrUserNotExist(err) {