mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-15 12:56:10 +00:00
refactor: wiki edit form (#38918)
1. the fragile `document.querySelector('.repository.wiki.new
.ui.form')!` is broken (again), rewrite to "data-global-init"
* regression from #37571 because a new form was added
3. use "form-fetch-action" and JSON response instead of
"RenderWithErrDeprecated"
This commit is contained in:
@@ -298,6 +298,7 @@ func GetFetchActionForm[T interface {
|
||||
}
|
||||
form := T(new(E))
|
||||
errs := binding.Bind(ctx.Req, form)
|
||||
errs = form.Validate(GetValidateContext(ctx.Req), errs)
|
||||
errorMessage, fieldName, _ := middleware.BuildValidationErrorForUser(form, ctx.Locale, errs)
|
||||
if errorMessage != "" {
|
||||
ctx.Resp.Header().Set("Content-Type", "application/json")
|
||||
|
||||
Reference in New Issue
Block a user