mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
Move web JSON functions to web context and simplify code (#26132)
The JSONRedirect/JSONOK/JSONError functions were put into "Base" context incorrectly, it would cause abuse. Actually, they are for "web context" only, so, move them to the correct place. And by the way, use them to simplify old code: +75 -196
This commit is contained in:
@ -42,7 +42,5 @@ func Stacktrace(ctx *context.Context) {
|
||||
func StacktraceCancel(ctx *context.Context) {
|
||||
pid := ctx.Params("pid")
|
||||
process.GetManager().Cancel(process.IDType(pid))
|
||||
ctx.JSON(http.StatusOK, map[string]any{
|
||||
"redirect": setting.AppSubURL + "/admin/monitor/stacktrace",
|
||||
})
|
||||
ctx.JSONRedirect(setting.AppSubURL + "/admin/monitor/stacktrace")
|
||||
}
|
||||
|
Reference in New Issue
Block a user