From d921d6967f331bb38f8a4548637087983c620e03 Mon Sep 17 00:00:00 2001 From: "eoghan.conlon" Date: Thu, 27 Jul 2023 19:57:53 +0100 Subject: [PATCH] [Sign-up_script] Script should call out api service --- src/PassReset/formHandler.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/PassReset/formHandler.js b/src/PassReset/formHandler.js index 80809ba..1f5fc7a 100644 --- a/src/PassReset/formHandler.js +++ b/src/PassReset/formHandler.js @@ -11,13 +11,11 @@ function formHandler(listener){ formData.append("field", "password"); formData.append("value", newPW); const object = Object.fromEntries(formData.entries()); - //TODO: Change this to use our api - fetch('https://reqres.in/api/update', { + fetch('https://api.sso.skynet.ie/ldap/update', { method: 'POST', body: object }).then(res => { - //TODO: Change success to use 200 rather than 201 (This is the code that the api testing service uses for the chosen api) - if(res.status === 201) { + if(res.status === 200) { document.getElementById('formStatus').innerHTML = "Success"; } else if (res.status === 500){ document.getElementById('formStatus').innerHTML = "Failure";