Skip to content

Commit f4bdcd6

Browse files
jolheiserzeripath
authored andcommitted
Only return JSON for add/remove all (#9028)
Signed-off-by: jolheiser <[email protected]>
1 parent 9feab29 commit f4bdcd6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

routers/org/teams.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ func TeamsRepoAction(ctx *context.Context) {
138138
}
139139

140140
var err error
141-
switch ctx.Params(":action") {
141+
action := ctx.Params(":action")
142+
switch action {
142143
case "add":
143144
repoName := path.Base(ctx.Query("repo_name"))
144145
var repo *models.Repository
@@ -167,9 +168,12 @@ func TeamsRepoAction(ctx *context.Context) {
167168
return
168169
}
169170

170-
ctx.JSON(200, map[string]interface{}{
171-
"redirect": ctx.Org.OrgLink + "/teams/" + ctx.Org.Team.LowerName + "/repositories",
172-
})
171+
if action == "addall" || action == "removeall" {
172+
ctx.JSON(200, map[string]interface{}{
173+
"redirect": ctx.Org.OrgLink + "/teams/" + ctx.Org.Team.LowerName + "/repositories",
174+
})
175+
return
176+
}
173177
ctx.Redirect(ctx.Org.OrgLink + "/teams/" + ctx.Org.Team.LowerName + "/repositories")
174178
}
175179

0 commit comments

Comments
 (0)