diff options
author | Nanguan Lin <70063547+lng2020@users.noreply.github.com> | 2023-10-23 20:34:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-23 20:34:17 +0800 |
commit | 61d94b247ab0c9289cd04253fed78283300e8c5e (patch) | |
tree | de13da7af615183a63ad2d2b0198af4657e819fe /routers/web/repo/milestone.go | |
parent | f3956fcb28e665ee7f2773f4ae14842405bb2462 (diff) | |
download | gitea-61d94b247ab0c9289cd04253fed78283300e8c5e.tar.gz gitea-61d94b247ab0c9289cd04253fed78283300e8c5e.zip |
Fix `link-action` redirect network error (#27734)
<img width="823" alt="image"
src="https://github.com/go-gitea/gitea/assets/70063547/99da3d5a-c28a-4fd0-8ae0-88461a9142e2">
---------
Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'routers/web/repo/milestone.go')
-rw-r--r-- | routers/web/repo/milestone.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/routers/web/repo/milestone.go b/routers/web/repo/milestone.go index 4db02fce9e..0e6f630747 100644 --- a/routers/web/repo/milestone.go +++ b/routers/web/repo/milestone.go @@ -231,14 +231,15 @@ func EditMilestonePost(ctx *context.Context) { // ChangeMilestoneStatus response for change a milestone's status func ChangeMilestoneStatus(ctx *context.Context) { - toClose := false + var toClose bool switch ctx.Params(":action") { case "open": toClose = false case "close": toClose = true default: - ctx.Redirect(ctx.Repo.RepoLink + "/milestones") + ctx.JSONRedirect(ctx.Repo.RepoLink + "/milestones") + return } id := ctx.ParamsInt64(":id") @@ -250,7 +251,7 @@ func ChangeMilestoneStatus(ctx *context.Context) { } return } - ctx.Redirect(ctx.Repo.RepoLink + "/milestones?state=" + url.QueryEscape(ctx.Params(":action"))) + ctx.JSONRedirect(ctx.Repo.RepoLink + "/milestones?state=" + url.QueryEscape(ctx.Params(":action"))) } // DeleteMilestone delete a milestone |