From 7b62b91830c92e3934bc10871b257628c58cdcde Mon Sep 17 00:00:00 2001 From: Emperor Numerius <62899740+EmperorNumerius@users.noreply.github.com> Date: Wed, 29 May 2024 16:29:48 -0600 Subject: [PATCH] fgds --- src/pages/index.astro | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pages/index.astro b/src/pages/index.astro index f39ed37..6c0600e 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -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: 'example@gmail.com', 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) {