More helpful message when FC validation fails

This commit is contained in:
Kalle
2024-03-05 22:22:41 +02:00
parent 2313b250b9
commit 54d00182f5

View File

@@ -26,7 +26,12 @@ export const frontPageSchema = z.union([
}),
z.object({
_action: _action("ADD_FRIEND_CODE"),
friendCode: z.string().regex(FRIEND_CODE_REGEXP),
friendCode: z
.string()
.regex(FRIEND_CODE_REGEXP, {
message:
"Invalid friend code. Did you include dashes? Example: 1234-5678-9012",
}),
}),
]);