Skip to content

Commit

Permalink
fgds
Browse files Browse the repository at this point in the history
  • Loading branch information
EmperorNumerius authored May 29, 2024
1 parent 081a8c1 commit 7b62b91
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ if (Astro.request.method === "POST") {
const data = await Astro.request.formData();
const name = data.get("name");
const email = data.get("email");
const response = await fetch('https://catapult.purplebubble.org/api/subscribe', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
});
fetch('https://catapult.purplebubble.org/api/subscribe', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ email: '[email protected]', name: 'Example User' }),
})
const jsondata = await response.json();
if (jsondata.ok = true){
//do nothing
}else{
error = jsondata.error;
}
body = JSON.stringify({ name: name, email: email})
}
catch (error) {
if (error instanceof Error) {
Expand Down

0 comments on commit 7b62b91

Please sign in to comment.