Skip to content

Commit

Permalink
Javascript linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmhaig committed Jul 4, 2023
1 parent 1fe96af commit 43388e4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/webpack/javascripts/modules/Modules.UnclaimedFees.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ 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.setSubmitButton()
Expand All @@ -25,8 +25,8 @@ moj.Modules.UnclaimedFees = {
const feesToAdd = this.checkBoxes.filter(box => box.checked)

const response = await fetch(this.url, {
method: "POST",
headers: { "Content-Type": "application/json" },
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
authenticity_token: this.token,
fees: feesToAdd.map(fee => fee.value)
Expand All @@ -40,4 +40,4 @@ moj.Modules.UnclaimedFees = {
}
})
}
}
}

0 comments on commit 43388e4

Please sign in to comment.