[pass-reset_script] Script should work, need to get assistance in calling our api
This commit is contained in:
parent
b80aa303ac
commit
e72f2b2377
1 changed files with 5 additions and 2 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue