Fix email form regex 🤦

This commit is contained in:
2022-07-07 14:15:56 +02:00
parent 2c4d46118e
commit d6c7ca5f70

View File

@@ -32,7 +32,7 @@
const formData = new FormData(target)
const email = String(formData.get('email'))
if (email && email.match('/^([\w.-])+@([\w.-])+\.([a-zA-Z])+/')) {
if (email && email.match(/^([\w.-])+@([\w.-])+\.([a-zA-Z])+/)) {
const req = await fetch('/api/newsletter', {
method: 'POST',
headers: { 'Content-Type': 'text/plain' },