mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-03 09:52:26 +02: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:
parent
338d03ce2f
commit
dcd3a63128
36 changed files with 75 additions and 196 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue