mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 18:58:38 +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:
@@ -2221,9 +2221,7 @@ func UpdateIssueMilestone(ctx *context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
ctx.JSON(http.StatusOK, map[string]any{
|
||||
"ok": true,
|
||||
})
|
||||
ctx.JSONOK()
|
||||
}
|
||||
|
||||
// UpdateIssueAssignee change issue's or pull's assignee
|
||||
@@ -2267,9 +2265,7 @@ func UpdateIssueAssignee(ctx *context.Context) {
|
||||
}
|
||||
}
|
||||
}
|
||||
ctx.JSON(http.StatusOK, map[string]any{
|
||||
"ok": true,
|
||||
})
|
||||
ctx.JSONOK()
|
||||
}
|
||||
|
||||
// UpdatePullReviewRequest add or remove review request
|
||||
@@ -2392,9 +2388,7 @@ func UpdatePullReviewRequest(ctx *context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
ctx.JSON(http.StatusOK, map[string]any{
|
||||
"ok": true,
|
||||
})
|
||||
ctx.JSONOK()
|
||||
}
|
||||
|
||||
// SearchIssues searches for issues across the repositories that the user has access to
|
||||
|
Reference in New Issue
Block a user