-
Notifications
You must be signed in to change notification settings - Fork 7
Conversation
Task linked: DEV-11849 Improve config validation for properties |
Deployed with Cloudflare Pages ☁️ 🚀 🆗 |
} catch (error: unknown) { | ||
ctx.addIssue({ | ||
code: z.ZodIssueCode.custom, | ||
message: formatMessage('errors_invalid_input', { | ||
name: capitalize(type), | ||
}), | ||
path: ['src'], | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we use error
object in the addIssue
? It should have the information about which field is invalid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the error: unknown
.
It should return the information about the invalid field if such error is thrown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { computedAsync } from '@vueuse/core' | ||
import { ZodEffects, ZodError, type ZodObject } from 'zod' | ||
|
||
export const useForm = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually once saw you using a form somewhere and was going to suggest something like useForm for vue but it seems you are implementing your own here
Ticket ID
DEV-11849
DEV-11908
DEV-11916
Description