From 552014a0689508d588c19bab8112d96461b3e528 Mon Sep 17 00:00:00 2001 From: Lucien Kerl Date: Sat, 1 Dec 2018 07:05:57 +0100 Subject: 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 * Update pull.go --- routers/api/v1/repo/pull.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'routers/api/v1') diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index a0117794ad..9fbadcd076 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -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) -- cgit v1.2.3