diff --git a/frontend/src/components/Layout/Footer.tsx b/frontend/src/components/Layout/Footer.tsx index 8a0eaea..bc3348f 100644 --- a/frontend/src/components/Layout/Footer.tsx +++ b/frontend/src/components/Layout/Footer.tsx @@ -14,18 +14,18 @@ const Footer = () => { if (email) { if (email.trim() === "") return; try { - const response = await fetch(`/api/send_newsletter/${email}`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - }); + const response = await fetch(`/api/send_newsletter/${email}`, + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + }); if (!response.ok) { throw new Error("Failed to subscribe"); } - + setEmail(""); alert("Successfully added to newsletter"); @@ -37,30 +37,19 @@ const Footer = () => { return ( );