fix claim.beggining
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Bernat Exposito Domenech 2020-06-16 12:00:38 +02:00
parent b6d50f7d8d
commit d80d520fba
1 changed files with 2 additions and 0 deletions

View File

@ -8,10 +8,12 @@ module.exports = Self => {
Self.validatesUniquenessOf('saleFk', { Self.validatesUniquenessOf('saleFk', {
message: `A claim with that sale already exists` message: `A claim with that sale already exists`
}); });
Self.observe('before save', async ctx => { Self.observe('before save', async ctx => {
if (ctx.isNewInstance) return; if (ctx.isNewInstance) return;
await claimIsEditable(ctx); await claimIsEditable(ctx);
}); });
Self.observe('before delete', async ctx => { Self.observe('before delete', async ctx => {
if (ctx.isNewInstance) return; if (ctx.isNewInstance) return;
await claimIsEditable(ctx); await claimIsEditable(ctx);