From a08ffff45b991d7b454f6859d2db198b7bdc9934 Mon Sep 17 00:00:00 2001 From: Janaka-Steph Date: Thu, 14 Dec 2023 21:33:54 +0100 Subject: [PATCH] Ghost email --- .idea/.gitignore | 3 --- _static/emails.js | 8 ++++++++ 2 files changed, 8 insertions(+), 3 deletions(-) delete mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/_static/emails.js b/_static/emails.js index 9fcdbd6..64a1d66 100644 --- a/_static/emails.js +++ b/_static/emails.js @@ -28,6 +28,14 @@ async function emailButtonClick() { let modal = document.getElementById('email-modal'); modal.style.display = 'none'; setCookie("address", emailInput.value, 365); // might fail if cookies disabled + fetch('https://state-of-open-source-ai.vercel.app/api/add-member', { + method: 'POST', + headers: {'Content-Type': 'application/json'}, + body: JSON.stringify({email: emailInput.value}) + }) + .then(response => response.json()) + .then(data => console.log(data)) + .catch(error => console.error('Error:', error)); } else { let emailError = document.getElementsByClassName('email-error')[0]; emailError.innerHTML = "Error: please enter a valid email";