Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Sequelize Model Validation!
You have completed Sequelize Model Validation!
Preview
Sequelize offers several built-in validators that allow you to specify validations for each attribute of the model, as well as custom error messages.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
And this response, we're seeing
the default error messages provided for
0:00
each validation error item.
0:00
Let's instead display clear and
more useful custom error messages.
0:02
Sequalize offers several built-in
validators that allow you to specify
0:07
validations for each attribute of the
model as well as custom error messages.
0:11
To begin using them, add a validate object
inside a models attribute object like so.
0:16
The notNull validator allows you to
customize the allowNull false error
0:25
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up