This commit is contained in:
parent
19fbb836a6
commit
eea09a9d4a
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue