Skip to content

Commit 552014a

Browse files
lucienkerltechknowlogick
authored andcommitted
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 <[email protected]> * Update pull.go
1 parent 06ef5b6 commit 552014a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/api/v1/repo/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ func EditPullRequest(ctx *context.APIContext, form api.EditPullRequestOption) {
405405
}
406406
}
407407

408-
if ctx.Repo.CanWrite(models.UnitTypePullRequests) && (form.Labels != nil && len(form.Labels) > 0) {
408+
if ctx.Repo.CanWrite(models.UnitTypePullRequests) && form.Labels != nil {
409409
labels, err := models.GetLabelsInRepoByIDs(ctx.Repo.Repository.ID, form.Labels)
410410
if err != nil {
411411
ctx.Error(500, "GetLabelsInRepoByIDsError", err)

0 commit comments

Comments
 (0)