Skip to content

Commit

Permalink
Ghost email
Browse files Browse the repository at this point in the history
  • Loading branch information
Janaka-Steph committed Dec 14, 2023
1 parent 5658a10 commit a08ffff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

8 changes: 8 additions & 0 deletions _static/emails.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit a08ffff

Please sign in to comment.