From aa369bc92c3890f2ca13bf74d24e036cec5f29e1 Mon Sep 17 00:00:00 2001 From: Kieran Klukas <92754843+kcoderhtml@users.noreply.github.com> Date: Sat, 14 Sep 2024 19:39:20 -0400 Subject: [PATCH] chore: temporarily disable loops signup Signed-off-by: Kieran Klukas <92754843+kcoderhtml@users.noreply.github.com> --- src/pages/index.astro | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/pages/index.astro b/src/pages/index.astro index 3cfe928..e8efd33 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -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,