Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
chore: temporarily disable loops signup
Browse files Browse the repository at this point in the history
Signed-off-by: Kieran Klukas <92754843+kcoderhtml@users.noreply.github.com>
  • Loading branch information
taciturnaxolotl authored Sep 14, 2024
1 parent d6fb552 commit aa369bc
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,16 @@ if (Astro.request.method === "POST") {
},
);
const loopsFormBody = `name=${encodeURIComponent(
name,
)}&email=${encodeURIComponent(email)}`;
const loops = await fetch(
"https://app.loops.so/api/newsletter-form/" +
import.meta.env.LOOPS_FORM_ID,
{
method: "POST",
body: loopsFormBody,
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
},
);
const jsondata = await response.json();
const loopsJson = await loops.json();
console.log(jsondata);
console.log(loopsJson);
if (jsondata.ok && loopsJson.success) {
if (jsondata.ok) {
error = { ok: true, message: "Success! You're in the loop." };
} else {
if (
!jsondata.ok &&
jsondata.message === "Email already subscribed" &&
loopsJson.success
jsondata.message === "Email already subscribed"
) {
error = {
ok: true,
Expand Down

0 comments on commit aa369bc

Please sign in to comment.