Skip to content

Commit

Permalink
Removing Labels via EditPullRequest API (#5348)
Browse files Browse the repository at this point in the history
* added the ability to provide an empty array at the EditPullRequests API to remove all labels

Signed-off-by: Lucien Kerl <[email protected]>

* Update pull.go
  • Loading branch information
lucienkerl authored and techknowlogick committed Dec 1, 2018
1 parent 06ef5b6 commit 552014a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/api/v1/repo/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 552014a

Please sign in to comment.