mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 20:32:11 +00:00
Add missing description of label on API (#7159)
* add missing description of label on API * fix comment head * fix swagger
This commit is contained in:
parent
367aeb169a
commit
d8168b356d
4 changed files with 32 additions and 11 deletions
|
@ -125,9 +125,10 @@ func CreateLabel(ctx *context.APIContext, form api.CreateLabelOption) {
|
|||
// "201":
|
||||
// "$ref": "#/responses/Label"
|
||||
label := &models.Label{
|
||||
Name: form.Name,
|
||||
Color: form.Color,
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
Name: form.Name,
|
||||
Color: form.Color,
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
Description: form.Description,
|
||||
}
|
||||
if err := models.NewLabel(label); err != nil {
|
||||
ctx.Error(500, "NewLabel", err)
|
||||
|
@ -185,6 +186,9 @@ func EditLabel(ctx *context.APIContext, form api.EditLabelOption) {
|
|||
if form.Color != nil {
|
||||
label.Color = *form.Color
|
||||
}
|
||||
if form.Description != nil {
|
||||
label.Description = *form.Description
|
||||
}
|
||||
if err := models.UpdateLabel(label); err != nil {
|
||||
ctx.ServerError("UpdateLabel", err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue