You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have the possibility to pass arguments to the z.string() function.
This would be useful to, for example, set the required_error option to some better message than just the default "Required"
One way of doing that could maybe look like this:
modelUser{idString @id @default(uuid())/// @zod {required_error: "Please enter a name"}nameString}
which would generate the following
exportconstUserModel=z.object({id: z.string(),name: z.string({required_error: "Please enter a name"})});
The text was updated successfully, but these errors were encountered:
It would be nice to have the possibility to pass arguments to the
z.string()
function.This would be useful to, for example, set the
required_error
option to some better message than just the default"Required"
One way of doing that could maybe look like this:
which would generate the following
The text was updated successfully, but these errors were encountered: