Browse Source

Removing Labels via EditPullRequest API (#5348)

* added the ability to provide an empty array at the EditPullRequests API to remove all labels

Signed-off-by: Lucien Kerl <lucien.kerl@wuerth-it.com>

* Update pull.go
for-closed-social
Lucien Kerl 6 years ago
committed by techknowlogick
parent
commit
552014a068
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      routers/api/v1/repo/pull.go

+ 1
- 1
routers/api/v1/repo/pull.go View File

@ -405,7 +405,7 @@ func EditPullRequest(ctx *context.APIContext, form api.EditPullRequestOption) {
}
}
if ctx.Repo.CanWrite(models.UnitTypePullRequests) && (form.Labels != nil && len(form.Labels) > 0) {
if ctx.Repo.CanWrite(models.UnitTypePullRequests) && form.Labels != nil {
labels, err := models.GetLabelsInRepoByIDs(ctx.Repo.Repository.ID, form.Labels)
if err != nil {
ctx.Error(500, "GetLabelsInRepoByIDsError", err)

Loading…
Cancel
Save