diff options
author | Unknown <joe2010xtmf@163.com> | 2014-05-24 15:34:02 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-05-24 15:34:02 -0400 |
commit | 87854c95a90cf1bebe1bffb833389471fb35f234 (patch) | |
tree | 95888810bd31f3fb99e16c646777636df96f950b /routers | |
parent | 80055bde86c21f1245a7b45ba30406db7640fec0 (diff) |
Fixed #200
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/issue.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 23f2480d..6e04288c 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -742,7 +742,15 @@ func UpdateLabel(ctx *middleware.Context, params martini.Params, form auth.Creat } func DeleteLabel(ctx *middleware.Context) { - strIds := strings.Split(ctx.Query("remove"), ",") + removes := ctx.Query("remove") + if len(strings.TrimSpace(removes)) == 0 { + ctx.JSON(200, map[string]interface{}{ + "ok": true, + }) + return + } + + strIds := strings.Split(removes, ",") for _, strId := range strIds { if err := models.DeleteLabel(ctx.Repo.Repository.Id, strId); err != nil { ctx.Handle(500, "issue.DeleteLabel(DeleteLabel)", err) |