forked from forgejo/forgejo
Replace convert.To with APIFormat calls
This commit is contained in:
parent
3f7f4852ef
commit
dccb0c15b9
21 changed files with 79 additions and 225 deletions
|
@ -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 ListIssueLabels(ctx *context.APIContext) {
|
||||
|
@ -25,7 +24,7 @@ func ListIssueLabels(ctx *context.APIContext) {
|
|||
|
||||
apiLabels := make([]*api.Label, len(issue.Labels))
|
||||
for i := range issue.Labels {
|
||||
apiLabels[i] = convert.ToLabel(issue.Labels[i])
|
||||
apiLabels[i] = issue.Labels[i].APIFormat()
|
||||
}
|
||||
ctx.JSON(200, &apiLabels)
|
||||
}
|
||||
|
@ -65,7 +64,7 @@ func AddIssueLabels(ctx *context.APIContext, form api.IssueLabelsOption) {
|
|||
|
||||
apiLabels := make([]*api.Label, len(labels))
|
||||
for i := range labels {
|
||||
apiLabels[i] = convert.ToLabel(labels[i])
|
||||
apiLabels[i] = issue.Labels[i].APIFormat()
|
||||
}
|
||||
ctx.JSON(200, &apiLabels)
|
||||
}
|
||||
|
@ -139,7 +138,7 @@ func ReplaceIssueLabels(ctx *context.APIContext, form api.IssueLabelsOption) {
|
|||
|
||||
apiLabels := make([]*api.Label, len(labels))
|
||||
for i := range labels {
|
||||
apiLabels[i] = convert.ToLabel(labels[i])
|
||||
apiLabels[i] = issue.Labels[i].APIFormat()
|
||||
}
|
||||
ctx.JSON(200, &apiLabels)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue