mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-03 09:52:26 +02:00
Related refactors to ctx.FormX functions (#16567)
* use FormTrim if posible * speedup goGet * only convert if nessesary
This commit is contained in:
parent
2d25b7d44b
commit
f1a810e090
22 changed files with 36 additions and 52 deletions
|
@ -1722,14 +1722,12 @@ func UpdateIssueContent(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
content := ctx.FormString("content")
|
||||
if err := issue_service.ChangeContent(issue, ctx.User, content); err != nil {
|
||||
if err := issue_service.ChangeContent(issue, ctx.User, ctx.Req.FormValue("content")); err != nil {
|
||||
ctx.ServerError("ChangeContent", err)
|
||||
return
|
||||
}
|
||||
|
||||
files := ctx.FormStrings("files[]")
|
||||
if err := updateAttachments(issue, files); err != nil {
|
||||
if err := updateAttachments(issue, ctx.FormStrings("files[]")); err != nil {
|
||||
ctx.ServerError("UpdateAttachments", err)
|
||||
return
|
||||
}
|
||||
|
@ -2157,8 +2155,7 @@ func UpdateCommentContent(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
files := ctx.FormStrings("files[]")
|
||||
if err := updateAttachments(comment, files); err != nil {
|
||||
if err := updateAttachments(comment, ctx.FormStrings("files[]")); err != nil {
|
||||
ctx.ServerError("UpdateAttachments", err)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue