styles, form, backend partial
All checks were successful
Lint / Lint (push) Successful in 1m8s

This commit is contained in:
2024-10-18 13:12:19 +02:00
parent 0406e1daf4
commit 4db42044ce
11 changed files with 530 additions and 71 deletions

19
lib/actions.ts Normal file
View File

@ -0,0 +1,19 @@
"use server";
import { z } from "zod";
import { oldestDate, signupFormSchema, youngestDate } from "@/app/sign-up/sign-up-form";
import listmonk from "./listmonk";
export async function signupFormSubmit(data: z.infer<typeof signupFormSchema>) {
if (data.dob > youngestDate || data.dob < oldestDate) {
return { error: "Invalid date of birth" };
}
const listmonkData = {
email: data.email,
name: data.name,
attribs: {
dob: data.dob.toISOString(),
},
};
console.log(listmonkData);
}