From b4862a8ce94dc86223967b38bc20da393841eeb5 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 12 Apr 2024 11:35:21 +0200 Subject: [PATCH] hotFix(claimBegginingModel): enable claimIsEditable and && --- modules/claim/back/models/claim-beginning.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/claim/back/models/claim-beginning.js b/modules/claim/back/models/claim-beginning.js index 4b870e5ea..d269b2285 100644 --- a/modules/claim/back/models/claim-beginning.js +++ b/modules/claim/back/models/claim-beginning.js @@ -19,7 +19,7 @@ module.exports = Self => { if (ticket.ticketFk != claim.ticketFk) throw new UserError(`Cannot create a new claimBeginning from a different ticket`); } - // await claimIsEditable(ctx); + await claimIsEditable(ctx); }); Self.observe('before delete', async ctx => { @@ -36,7 +36,7 @@ module.exports = Self => { if (ctx.options && ctx.options.transaction) myOptions.transaction = ctx.options.transaction; - const claimBeginning = await Self.findById(ctx.where.id); + const claimBeginning = ctx.instance ?? await Self.findById(ctx.where.id); const filter = { where: {id: claimBeginning.claimFk},