Skip to content

Commit

Permalink
FIX BackgroundSync SC
Browse files Browse the repository at this point in the history
  • Loading branch information
Spomky committed Mar 7, 2024
1 parent d68307a commit 71c7f9f
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions assets/src/backgroundsync-form_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ export default class extends Controller {
event.preventDefault();
const form = this.element;
if (!form instanceof HTMLFormElement || !form.checkValidity()) {
console.error('Form is not valid', form, form.checkValidity());
return;
}
console.error(form.method);

const url = form.action;
try {
Expand All @@ -34,10 +32,8 @@ export default class extends Controller {
params.method = form.method.toUpperCase();
await fetch(url, params);
} catch (error) {
console.error('Error while sending form', error);
// No need to do anything here
} finally {
console.log('finally', this.redirectionValue);
window.location.href = this.redirectionValue || url;
}
}
Expand Down

0 comments on commit 71c7f9f

Please sign in to comment.