From eea09a9d4ae250a351d90e0fe65030da882c6cd2 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 21 Oct 2024 09:24:53 +0200 Subject: [PATCH] fix: refs #6850 add code --- modules/claim/back/methods/claim/updateClaim.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/claim/back/methods/claim/updateClaim.js b/modules/claim/back/methods/claim/updateClaim.js index f2f3f9050..563b5b53d 100644 --- a/modules/claim/back/methods/claim/updateClaim.js +++ b/modules/claim/back/methods/claim/updateClaim.js @@ -85,13 +85,11 @@ module.exports = Self => { const updatedClaim = await claim.updateAttributes(args, myOptions); const salesPerson = claim.client().salesPersonUser(); - if (salesPerson) { - if (args.claimStateFk) { - const newState = await models.ClaimState.findById(args.claimStateFk, null, myOptions); - await notifyStateChange(ctx, salesPerson.id, claim, newState.description); - if (newState.code == 'canceled') - await notifyStateChange(ctx, claim.workerFk, claim, newState.description); - } + if (salesPerson && args.claimStateFk) { + const newState = await models.ClaimState.findById(args.claimStateFk, null, myOptions); + await notifyStateChange(ctx, salesPerson.id, claim, newState.description); + if (newState.code == 'canceled') + await notifyStateChange(ctx, claim.workerFk, claim, newState.description); } if (tx) await tx.commit();