From e72f2b2377ad30fa4a46cc0b9f46a3a4b1c767cb Mon Sep 17 00:00:00 2001 From: "eoghan.conlon" Date: Thu, 27 Jul 2023 18:36:34 +0100 Subject: [PATCH] [pass-reset_script] Script should work, need to get assistance in calling our api --- src/PassReset/formHandler.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/PassReset/formHandler.js b/src/PassReset/formHandler.js index 791bb4e..75301f9 100644 --- a/src/PassReset/formHandler.js +++ b/src/PassReset/formHandler.js @@ -23,9 +23,12 @@ formEl.addEventListener('submit', () => { formData.append("field", "password"); formData.append("value", newPW); const object = Object.fromEntries(formData.entries()); - console.log({ object }); + fetch('https://reqres.in/api/update', { + method: 'POST', + body: object + }).then(res => console.log(res)).catch(error => console.log(error)); //TODO: Change this to changing a div in html - alert("Success"); + //alert("Success"); } else { //TODO: Change this to changing a div in html alert("Failure")