hotFix(updateClaim): salesPerson undefined
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2024-05-30 08:14:10 +02:00
parent 255a2c5283
commit f9d25ccd6c
1 changed files with 10 additions and 8 deletions

View File

@ -88,7 +88,8 @@ module.exports = Self => {
const updatedClaim = await claim.updateAttributes(args, myOptions);
// When pickup has been changed
if (salesPerson && changedPickup && updatedClaim.pickup)
if (salesPerson) {
if (changedPickup && updatedClaim.pickup)
await notifyPickUp(ctx, salesPerson.id, claim);
// When claimState has been changed
@ -98,6 +99,7 @@ module.exports = Self => {
if (newState.code == 'canceled')
await notifyStateChange(ctx, claim.workerFk, claim, newState.description);
}
}
if (tx) await tx.commit();