diff --git a/modules/claim/back/models/claim-beginning.js b/modules/claim/back/models/claim-beginning.js index 3cf372ab2..19e5eb4eb 100644 --- a/modules/claim/back/models/claim-beginning.js +++ b/modules/claim/back/models/claim-beginning.js @@ -8,10 +8,12 @@ module.exports = Self => { Self.validatesUniquenessOf('saleFk', { message: `A claim with that sale already exists` }); + Self.observe('before save', async ctx => { if (ctx.isNewInstance) return; await claimIsEditable(ctx); }); + Self.observe('before delete', async ctx => { if (ctx.isNewInstance) return; await claimIsEditable(ctx);