forked from forgejo/forgejo
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:
parent
338d03ce2f
commit
dcd3a63128
36 changed files with 75 additions and 196 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue