Skip to content
Discussion options

You must be logged in to vote

I ended up doing it with a superRefine:

z.object({
	emails: z.string()
}).superRefine((data, ctx) => {
	const emails = emails.trim().toLowerCase().split(",");
	...
	ctx.issues.push({
		code: "too_small",
		minimum: 1,
		origin: "array",
		message: "Please enter at least one email",
		path: ["emails"],
		inclusive: true,
		input: emails,
	});
	...
});

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by mwkcoding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant