[pass-reset_script] Script should work, need to get assistance in calling our api

This commit is contained in:
eoghan.conlon 2023-07-27 18:36:34 +01:00
parent b80aa303ac
commit e72f2b2377

View file

@ -23,9 +23,12 @@ formEl.addEventListener('submit', () => {
formData.append("field", "password"); formData.append("field", "password");
formData.append("value", newPW); formData.append("value", newPW);
const object = Object.fromEntries(formData.entries()); 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 //TODO: Change this to changing a div in html
alert("Success"); //alert("Success");
} else { } else {
//TODO: Change this to changing a div in html //TODO: Change this to changing a div in html
alert("Failure") alert("Failure")