Replies: 2 comments 1 reply
-
I converted this to a discussion because it doesn't seem like an issue report. Interesting use-case. But I would like to understand more. How would the state reach that point? As how would the user end up sending incorrect input or extra input to the API through the UI? How do you expect them to correct that mistake if you show the error? For example, I'm a user who can see 3 fields at the moment. To me, it sounds like client-side UI and validation should've caught this and prevented presenting and sending a non-valid request in this case. I also work with very strict server and GraphQL schemas with nested structures with a lot of |
Beta Was this translation helpful? Give feedback.
-
Currently it is tedious to filter through the validation errors and see if the source of the issue is not a filed that does not exist. For more dynamic forms I'm not sure how I'd even do it. I don't know how the handling is implemented in VeeValidate, but if there already is a function that tells it that the input does not exist, exposing it might just be what is needed. In the error handler, I could simply ask VeeValidate if it recognizes the input, and handle the issue if it does not. errorsFromServer.forEach(
(v) => actions.inputExists(v.source) ? actions.setFieldError(v.source, v.message) : logThisIssue(v)
) |
Beta Was this translation helpful? Give feedback.
-
I'm using a strict server validation and what happens is on extra field, there is no visual feedback and to process the error is very laborous.
Example setup:
anomaly
,boom
,cone
,boom
andcone
The problem is that the
v.source
is equal toanomaly
and thus the error message ("Extra fieldanomaly
present in the request.") is NOT shown anywhere.The ideal solution would be the ability to set a callback that would process the unprocessed errors.
I don't have enough knowledge to say how that fits with VeeValidate, unfortunatelly. I'd assume the setter (and potentially the getter too) would be part of the
actions
object, something likeactions.setUnprocessedErrorHandler(myHandlerForUnprocessedErrors)
.I reported the same issue with Formkit and it was one of 3 reasons why we're considering moving away from Formkit, and here I am testing VeeValidate, to be honest.
[Vue v3, VeeValidate v4.x]
Beta Was this translation helpful? Give feedback.
All reactions