aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1
diff options
context:
space:
mode:
authorLucien Kerl <lucien@kerl.io>2018-12-01 07:05:57 +0100
committertechknowlogick <hello@techknowlogick.com>2018-12-01 01:05:57 -0500
commit552014a0689508d588c19bab8112d96461b3e528 (patch)
treebf9209e97548f2bf6f948d0f6b8d2f6f905832ab /routers/api/v1
parent06ef5b68d4ae3e51de57f283d63cb690d22296cf (diff)
downloadgitea-552014a0689508d588c19bab8112d96461b3e528.tar.gz
gitea-552014a0689508d588c19bab8112d96461b3e528.zip
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
Diffstat (limited to 'routers/api/v1')
-rw-r--r--routers/api/v1/repo/pull.go2
1 files changed, 1 insertions, 1 deletions
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)