diff options
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) { |