Skip to content

Commit 01934b2

Browse files
committed
Fix some class mutations
1 parent 2bb7009 commit 01934b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Resources/public/js/dialog.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,9 @@ export default class Dialog {
3838
/** @type {HTMLFormElement} */
3939
const form = event.target;
4040

41-
const formData = new FormData(form);
42-
4341
fetch(form.action, {
4442
method: form.method || 'POST',
45-
body: formData,
43+
body: new FormData(form),
4644
headers: {
4745
'X-Requested-With': 'XMLHttpRequest',
4846
},
@@ -55,8 +53,10 @@ export default class Dialog {
5553
})
5654
.then((result) => {
5755
if(result.success) {
56+
element.classList.remove('error');
5857
element.classList.add('success');
5958
} else {
59+
element.classList.remove('success');
6060
element.classList.add('error');
6161
element.querySelector('.ssrn-error-message').innerHTML = result.errors.join('<br>');
6262
}

0 commit comments

Comments
 (0)