Closed ghost closed 8 years ago
Is it possible to add extra validation inside a hook? i.e.:
beforeSave: function (Entity) { if (Entity.someValue > 10000) { throw new Exception("someValue is wrong"); } }
I've also tried to return a rejected Promise, as the docs says, but I can't prevent saving.
@IGZgustavomarin you can add ValidationError dependency and throw it as follows: throw new ValidationError({field: "field error message"})
ValidationError
throw new ValidationError({field: "field error message"})
Is it possible to add extra validation inside a hook? i.e.:
I've also tried to return a rejected Promise, as the docs says, but I can't prevent saving.