Only return JSON for add/remove all (#9028)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
lunny/display_deleted_branch2
John Olheiser 5 years ago committed by zeripath
parent 9feab29405
commit f4bdcd6e2b

@ -138,7 +138,8 @@ func TeamsRepoAction(ctx *context.Context) {
}
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
@ -167,9 +168,12 @@ func TeamsRepoAction(ctx *context.Context) {
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")
}

Loading…
Cancel
Save