Open MichaelSel opened 2 years ago
If you wrote about validation function to seperate then none of them. Models should be responsible of their own validation, which joi validation on top level of arch, should be responsible of incoming data, which can be different from model. The common code is regex expression which could be seperated out (to utils folder maybe).
The password validation in the user.model.js file is identical to the one defined in custom.validation.js. Is this code duplication by design or an oversight?