From 064ce8d5f883ecf4417cc293aa7e81a2e3e0283b Mon Sep 17 00:00:00 2001 From: Joe Haig Date: Tue, 4 Jul 2023 17:13:11 +0100 Subject: [PATCH] Javascript linting --- .../modules/Modules.UnclaimedFees.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/webpack/javascripts/modules/Modules.UnclaimedFees.js b/app/webpack/javascripts/modules/Modules.UnclaimedFees.js index d081a6591b..750038f96b 100644 --- a/app/webpack/javascripts/modules/Modules.UnclaimedFees.js +++ b/app/webpack/javascripts/modules/Modules.UnclaimedFees.js @@ -3,11 +3,11 @@ moj.Modules.UnclaimedFees = { this.checkListWrapper = document.getElementById('mod-unclaimed-fees') if (this.checkListWrapper) { this.button = document.getElementById('add-unclaimed-fees') - const form = this.button.closest("form") - this.url = form.getAttribute("action") - this.token = Array.from(form.getElementsByTagName("input")).filter(i => i.getAttribute("name") === "authenticity_token")[0].value + const form = this.button.closest('form') + this.url = form.getAttribute('action') + this.token = Array.from(form.getElementsByTagName('input')).filter(i => i.getAttribute('name') === 'authenticity_token')[0].value this.checkBoxes = Array.from(this.checkListWrapper.getElementsByClassName('govuk-checkboxes__input')) - this.checkBoxes.forEach(box => box.onchange = () => this.setSubmitButton()) + this.checkBoxes.forEach(box => { box.onchange = () => this.setSubmitButton() }) this.setSubmitButton() this.button.addEventListener('click', (event) => this.submit(event)) } @@ -24,20 +24,20 @@ moj.Modules.UnclaimedFees = { const feesToAdd = this.checkBoxes.filter(box => box.checked) - const response = await fetch(this.url, { - method: "POST", - headers: { "Content-Type": "application/json" }, + await fetch(this.url, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ authenticity_token: this.token, fees: feesToAdd.map(fee => fee.value) }) }).then(response => { if (response.ok) { - feesToAdd.forEach(box => box.disabled = true) + feesToAdd.forEach(box => { box.disabled = true }) this.setSubmitButton() } else { console.log('There was a problem') } }) } -} \ No newline at end of file +}