diff options
author | John Olheiser <42128690+jolheiser@users.noreply.github.com> | 2019-11-16 11:36:13 -0600 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-11-16 17:36:13 +0000 |
commit | f4bdcd6e2b28763919671c2c87fe68fd9bf43373 (patch) | |
tree | 8ffdf6e13ea64f082de6e4adae576d7991cb2891 /routers/org | |
parent | 9feab2940598343cb28350063e1f9d781208552b (diff) | |
download | gitea-f4bdcd6e2b28763919671c2c87fe68fd9bf43373.tar.gz gitea-f4bdcd6e2b28763919671c2c87fe68fd9bf43373.zip |
Only return JSON for add/remove all (#9028)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'routers/org')
-rw-r--r-- | routers/org/teams.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/routers/org/teams.go b/routers/org/teams.go index 36a2847355..873265803f 100644 --- a/routers/org/teams.go +++ b/routers/org/teams.go @@ -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") } |