Fix Newsletter form types
This commit is contained in:
@@ -30,8 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
const formSubmission = async ({ target }) => {
|
const formSubmission = async ({ target }) => {
|
||||||
const formData = new FormData(target)
|
const formData = new FormData(target)
|
||||||
const formValues = Object.fromEntries(formData)
|
const email = String(formData.get('email'))
|
||||||
const { email } = formValues
|
|
||||||
|
|
||||||
if (email && email.match('/^([\w.-])+@([\w.-])+\.([a-zA-Z])+/')) {
|
if (email && email.match('/^([\w.-])+@([\w.-])+\.([a-zA-Z])+/')) {
|
||||||
const req = await fetch('/api/newsletter', {
|
const req = await fetch('/api/newsletter', {
|
||||||
|
|||||||
Reference in New Issue
Block a user