File tree Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Original file line number Diff line number Diff 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 >
You can’t perform that action at this time.
0 commit comments