Answer the question
In order to leave comments, you need to log in
How to do dynamic validation?
I would like to register users and, depending on their status "just a user" or "professional", validate the fields. Those. if "just a user", then only "email", "password" is enough on the server, and if "professional", then these fields are validated (necessary) + more (also necessary). Does this validation need to be somehow specially described in the model (Mongoose) or is it all done at the Express controller level? type, "if such and such, then the data goes into the model such and such." Is there any example?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question