Skip to content

Commit cba8f9c

Browse files
committed
Remove logging to the console
1 parent a01009b commit cba8f9c

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

src/components/social/SocialSubscribe.astro

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,28 +66,20 @@ const socialLinks = [
6666
if (!(input instanceof HTMLInputElement)) return;
6767

6868
const email = input.value.trim();
69-
if (!email) return alert("Please enter a valid email");
69+
if (!email) return;
7070

7171
try {
72-
const result = await fetch(
73-
"https://blog.europython.eu/members/api/send-magic-link/",
74-
{
75-
method: "POST",
76-
headers: { "Content-Type": "application/json" },
77-
body: JSON.stringify({ email, emailType: "subscribe" })
78-
}
79-
);
72+
const result = await fetch("https://blog.europython.eu/members/api/send-magic-link/", {
73+
method: "POST",
74+
headers: { "Content-Type": "application/json" },
75+
body: JSON.stringify({ email, emailType: "subscribe" })
76+
});
8077

8178
const r = await result.text();
82-
if (r !== "Created.") {
83-
alert("Something went wrong");
84-
} else {
85-
alert("Check your inbox!");
79+
if (r === "Created.") {
8680
input.value = "";
8781
}
8882
} catch (e) {
89-
console.error(e);
90-
alert("Network error");
9183
}
9284
}
9385
</script>

0 commit comments

Comments
 (0)