<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>
// 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")
}
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
// ChangeProjectStatus updates the status of a project between "open" and "close"
func ChangeProjectStatus(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 + "/projects")
+ ctx.JSONRedirect(ctx.Repo.RepoLink + "/projects")
+ return
}
id := ctx.ParamsInt64(":id")
}
return
}
- ctx.Redirect(ctx.Repo.RepoLink + "/projects?state=" + url.QueryEscape(ctx.Params(":action")))
+ ctx.JSONRedirect(ctx.Repo.RepoLink + "/projects?state=" + url.QueryEscape(ctx.Params(":action")))
}
// DeleteProject delete a project