}
var err error
- switch ctx.Params(":action") {
+ action := ctx.Params(":action")
+ switch action {
case "add":
repoName := path.Base(ctx.Query("repo_name"))
var repo *models.Repository
return
}
- ctx.JSON(200, map[string]interface{}{
- "redirect": ctx.Org.OrgLink + "/teams/" + ctx.Org.Team.LowerName + "/repositories",
- })
+ if action == "addall" || action == "removeall" {
+ ctx.JSON(200, map[string]interface{}{
+ "redirect": ctx.Org.OrgLink + "/teams/" + ctx.Org.Team.LowerName + "/repositories",
+ })
+ return
+ }
ctx.Redirect(ctx.Org.OrgLink + "/teams/" + ctx.Org.Team.LowerName + "/repositories")
}