aikutto
aikutto

Reputation: 592

Sequelize validate not working on save()

I have a sequelize model with a validation like this:

validate: {
    isEmail: {msg: 'This field must be an E-Mail!'}
}

It's working when I use .create() method but not working when I use .update()/.save() methods. What did I do something wrong?

Thanks in advance.

Upvotes: 1

Views: 968

Answers (1)

user3254198
user3254198

Reputation: 759

To validate the instance you can call .validate() on the model instance as well.

Upvotes: 1

Related Questions