Skip to content

Commit

Permalink
Update transaction violations when the money request is paid
Browse files Browse the repository at this point in the history
  • Loading branch information
marcochavezf committed Oct 30, 2024
1 parent a4c8de6 commit 528d544
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6956,6 +6956,26 @@ function getPayMoneyRequestParams(
},
});
}

const optimisticTransactionViolations: OnyxUpdate[] = reportTransactions.map(({transactionID}) => {
const violations = allTransactionViolations[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`] ?? [];
return {
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`,
value: null,
};
});
optimisticData.push(...optimisticTransactionViolations);

const failureTransactionViolations: OnyxUpdate[] = reportTransactions.map(({transactionID}) => {
const violations = allTransactionViolations[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`] ?? [];
return {
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`,
value: violations,
};
});
failureData.push(...failureTransactionViolations);
}

let optimisticHoldReportID;
Expand Down

0 comments on commit 528d544

Please sign in to comment.