diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-01-11 10:59:41 +0800 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2020-01-10 21:59:41 -0500 |
commit | 4d06d10dbafe7cfd404889b636d8e243058ee96f (patch) | |
tree | e8107acad719b45f2732b0736d4657cac65fb679 /routers/api/v1/repo | |
parent | 705b1e49a8b2ac8df377120f70f3548df15cdf49 (diff) | |
download | gitea-4d06d10dbafe7cfd404889b636d8e243058ee96f.tar.gz gitea-4d06d10dbafe7cfd404889b636d8e243058ee96f.zip |
Move tracked time api convert to convert package (#9665)
Diffstat (limited to 'routers/api/v1/repo')
-rw-r--r-- | routers/api/v1/repo/issue_tracked_time.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/routers/api/v1/repo/issue_tracked_time.go b/routers/api/v1/repo/issue_tracked_time.go index dd959192c9..323bf67d8e 100644 --- a/routers/api/v1/repo/issue_tracked_time.go +++ b/routers/api/v1/repo/issue_tracked_time.go @@ -12,6 +12,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/context" + "code.gitea.io/gitea/modules/convert" api "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/routers/api/v1/utils" ) @@ -93,7 +94,7 @@ func ListTrackedTimes(ctx *context.APIContext) { ctx.Error(http.StatusInternalServerError, "LoadAttributes", err) return } - ctx.JSON(http.StatusOK, trackedTimes.APIFormat()) + ctx.JSON(http.StatusOK, convert.ToTrackedTimeList(trackedTimes)) } // AddTime add time manual to the given issue @@ -178,7 +179,7 @@ func AddTime(ctx *context.APIContext, form api.AddTimeOption) { ctx.Error(http.StatusInternalServerError, "LoadAttributes", err) return } - ctx.JSON(http.StatusOK, trackedTime.APIFormat()) + ctx.JSON(http.StatusOK, convert.ToTrackedTime(trackedTime)) } // ResetIssueTime reset time manual to the given issue @@ -399,7 +400,7 @@ func ListTrackedTimesByUser(ctx *context.APIContext) { ctx.Error(http.StatusInternalServerError, "LoadAttributes", err) return } - ctx.JSON(http.StatusOK, trackedTimes.APIFormat()) + ctx.JSON(http.StatusOK, convert.ToTrackedTimeList(trackedTimes)) } // ListTrackedTimesByRepository lists all tracked times of the repository @@ -486,7 +487,7 @@ func ListTrackedTimesByRepository(ctx *context.APIContext) { ctx.Error(http.StatusInternalServerError, "LoadAttributes", err) return } - ctx.JSON(http.StatusOK, trackedTimes.APIFormat()) + ctx.JSON(http.StatusOK, convert.ToTrackedTimeList(trackedTimes)) } // ListMyTrackedTimes lists all tracked times of the current user @@ -530,5 +531,5 @@ func ListMyTrackedTimes(ctx *context.APIContext) { return } - ctx.JSON(http.StatusOK, trackedTimes.APIFormat()) + ctx.JSON(http.StatusOK, convert.ToTrackedTimeList(trackedTimes)) } |