mirror of
https://github.com/go-gitea/gitea
synced 2024-12-23 09:04:26 +00:00
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
This commit is contained in:
parent
06ef5b68d4
commit
552014a068
@ -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)
|
labels, err := models.GetLabelsInRepoByIDs(ctx.Repo.Repository.ID, form.Labels)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.Error(500, "GetLabelsInRepoByIDsError", err)
|
ctx.Error(500, "GetLabelsInRepoByIDsError", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user