diff options
author | Unknwon <u@gogs.io> | 2016-08-14 04:17:26 -0700 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-08-14 04:17:26 -0700 |
commit | dccb0c15b996ac4dc0307cbfed140ce1558d7e3c (patch) | |
tree | 97593eae3a1023296c2c03258e6bc4ae4c02b6bf /routers/api/v1/repo/label.go | |
parent | 3f7f4852efaaa56a0dada832dc652a1fc8869ae7 (diff) | |
download | gitea-dccb0c15b996ac4dc0307cbfed140ce1558d7e3c.tar.gz gitea-dccb0c15b996ac4dc0307cbfed140ce1558d7e3c.zip |
Replace convert.To with APIFormat calls
Diffstat (limited to 'routers/api/v1/repo/label.go')
-rw-r--r-- | routers/api/v1/repo/label.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/routers/api/v1/repo/label.go b/routers/api/v1/repo/label.go index dfd0b1ddda..5c34849385 100644 --- a/routers/api/v1/repo/label.go +++ b/routers/api/v1/repo/label.go @@ -9,7 +9,6 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/routers/api/v1/convert" ) func ListLabels(ctx *context.APIContext) { @@ -21,7 +20,7 @@ func ListLabels(ctx *context.APIContext) { apiLabels := make([]*api.Label, len(labels)) for i := range labels { - apiLabels[i] = convert.ToLabel(labels[i]) + apiLabels[i] = labels[i].APIFormat() } ctx.JSON(200, &apiLabels) } @@ -37,7 +36,7 @@ func GetLabel(ctx *context.APIContext) { return } - ctx.JSON(200, convert.ToLabel(label)) + ctx.JSON(200, label.APIFormat()) } func CreateLabel(ctx *context.APIContext, form api.CreateLabelOption) { @@ -55,7 +54,7 @@ func CreateLabel(ctx *context.APIContext, form api.CreateLabelOption) { ctx.Error(500, "NewLabel", err) return } - ctx.JSON(201, convert.ToLabel(label)) + ctx.JSON(201, label.APIFormat()) } func EditLabel(ctx *context.APIContext, form api.EditLabelOption) { @@ -84,7 +83,7 @@ func EditLabel(ctx *context.APIContext, form api.EditLabelOption) { ctx.Handle(500, "UpdateLabel", err) return } - ctx.JSON(200, convert.ToLabel(label)) + ctx.JSON(200, label.APIFormat()) } func DeleteLabel(ctx *context.APIContext) { |