OMB - hmm... I know this issue was closed way b...
hmm... I know this issue was closed way back, but why does this work and not this? note that the feature in question is the .refine(), the former works well and as expected, but the latter... it should work, but the .refine() is not triggered... can someone enlighten me with this?
24 Replies
Unknown User•12mo ago
Message Not Public
Sign In & Join Server To View
can you reiterate, i don't understand what you mean by object im passing, forgive me
Unknown User•12mo ago
Message Not Public
Sign In & Join Server To View
ahh, but it does not run even if email is valid
let me show you some samples
this is when Im using the latter code,
this is when I use the former. No errors on both, no warnings, no indicator what-so-ever
to be honest i'm quite perplexed as to why separating the two schemas and joining them works
Unknown User•12mo ago
Message Not Public
Sign In & Join Server To View
this is the "not splitted" schema
this is the "splitted" schema
both seem to return false, which is intended
this just leaves us now with the .refine()
Unknown User•12mo ago
Message Not Public
Sign In & Join Server To View
top one is the "not-splitted"
this is the error object on the top one expanded
this is for the bottom one
Unknown User•12mo ago
Message Not Public
Sign In & Join Server To View
Looks like your values are
undefined
here, which will fail to run the refine until the object passes validation.so this means that before refine will run, each object should pass the validation? i.e. firstname, lastname, etc. ?
Unknown User•12mo ago
Message Not Public
Sign In & Join Server To View
if that's the case, then it makes sense now since if we split the password validation from the other stuff, it would check on it's own, effectively ignoring the other validators that could prevent it from running the refine
Solution
Unknown User•12mo ago
Message Not Public
Sign In & Join Server To View
oh! now i see what you mean earlier, sorry for not being able to understand it
Unknown User•12mo ago
Message Not Public
Sign In & Join Server To View
thank you! I'm new to these kinds of stuff, I learned alot from this short exchange ❤️