Skip to content

postgrelize / ValidationFailed

Variable: ValidationFailed ​

const ValidationFailed: ModelStaticMethodDecorator

Defined in: src/decorators/hook-decorators.ts:47

Registers the decorated static method as a validationFailed hook of the model (like Model.validationFailed). The method receives the hook arguments; static methods only. Registered when sequelize.addModels applies the class. Accepts the TC39 and the legacy experimentalDecorators call signature.

Example ​

ts
class User extends Model {
  @ValidationFailed
  static async onValidationFailed(user: User, options: unknown, error: unknown) {}
}

Released under the MIT License.