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
What I am curious about if there is a way for me to say in the updateUserValidator that I explicitly do not want to include a property like the id. I know that I can move the property out of the base validator and structure it like this, but I ran into a couple of cases where having vine.never(), or a way to exclude/omit a property out of an existing schema would simplify the code a lot, or give me more confidence.
While having the never schema type will work at the top-level. I am not sure if you can make it work at nested levels as well. So if you have any suggestions, feel free to share them.
Unrelated. Mindset shift can also help solve this problem
This is where I usually prefer to write duplicate schemas and not try to overuse an existing schema and create multiple combinations out of it.
I understand that DRY as a concept is very much advocated for, but in some places duplication leads to writing simple code. Just sharing an article on the Wet codebase analogy for anyone who is interested to read it. https://overreacted.io/the-wet-codebase/
I have a validator that looks like this
I then export them for my store and update controller endpoints to be used like this
What I am curious about if there is a way for me to say in the
updateUserValidator
that I explicitly do not want to include a property like theid
. I know that I can move the property out of the base validator and structure it like this, but I ran into a couple of cases where having vine.never(), or a way to exclude/omit a property out of an existing schema would simplify the code a lot, or give me more confidence.The text was updated successfully, but these errors were encountered: