Fix complex form data during form saving

Similarly to #1510, sending encoded form and using parse_str for FormSaver, which was still using the old way.
This commit is contained in:
Alex P 2023-09-12 10:02:15 +03:00
parent bd974a7922
commit 5c3be69c78
No known key found for this signature in database
GPG key ID: 54487A734A204D71

View file

@ -6,7 +6,6 @@ export default class FormSaver {
async save(form) {
const formData = new FormData(form);
const formJsonObj = Object.fromEntries(formData.entries());
const res = await fetch(this.url, {
method: 'POST',
@ -16,7 +15,7 @@ export default class FormSaver {
credentials: 'same-origin',
body: JSON.stringify({
nonce: this.nonce,
form: formJsonObj,
form_encoded: new URLSearchParams(formData).toString(),
}),
});