Skip to content

Commit

Permalink
Merge pull request #3059 from uktrade/ET-103-task-validation-form-fixes
Browse files Browse the repository at this point in the history
ET-103: task validation modal tweaks
  • Loading branch information
lewis-coulson-dit authored May 7, 2024
2 parents 8495b09 + cae7b39 commit eb82d35
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/static/javascript/great.task-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,19 @@ GreatFrontend.TaskValidation = {
button.addEventListener('click', async (e) => {
e.preventDefault()

const csrfToken = document.querySelector(
'[name=csrfmiddlewaretoken]'
).value

try {
await fetch('/contact/task-validation', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRFToken': csrfToken,
},
body: JSON.stringify({
question: question,
question: question.innerHTML,
answer: button.innerText,
}),
})
Expand Down

0 comments on commit eb82d35

Please sign in to comment.