fix: refs #6850 remove notifyPickUp #3132

Merged
carlossa merged 5 commits from 6850-removeChandgeUpdateClaim into dev 2024-10-21 12:31:32 +00:00
1 changed files with 5 additions and 7 deletions
Showing only changes of commit eea09a9d4a - Show all commits

View File

@ -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) {
carlossa marked this conversation as resolved Outdated
Outdated
Review

fica el altre if en un and y ahorres tindre 2 ifs

fica el altre if en un and y ahorres tindre 2 ifs
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();