hotFix(claimBegginingModel): enable claimIsEditable and &&
gitea/salix/pipeline/pr-master This commit looks good Details

This commit is contained in:
Alex Moreno 2024-04-12 11:35:21 +02:00
parent cb1bb4ebc4
commit b4862a8ce9
1 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ module.exports = Self => {
if (ticket.ticketFk != claim.ticketFk) if (ticket.ticketFk != claim.ticketFk)
throw new UserError(`Cannot create a new claimBeginning from a different ticket`); throw new UserError(`Cannot create a new claimBeginning from a different ticket`);
} }
// await claimIsEditable(ctx); await claimIsEditable(ctx);
}); });
Self.observe('before delete', async ctx => { Self.observe('before delete', async ctx => {
@ -36,7 +36,7 @@ module.exports = Self => {
if (ctx.options && ctx.options.transaction) if (ctx.options && ctx.options.transaction)
myOptions.transaction = 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 = { const filter = {
where: {id: claimBeginning.claimFk}, where: {id: claimBeginning.claimFk},