Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
ShridharGoel committed Jul 23, 2024
1 parent 9f2bb42 commit 99fb15c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
7 changes: 7 additions & 0 deletions src/hooks/__mocks__/usePermissions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* @returns A mock of the usePermissions hook.
*/
const usePermissions = () => ({
canUseViolations: true,
});
export default usePermissions;
13 changes: 5 additions & 8 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5500,14 +5500,11 @@ function cleanUpMoneyRequest(transactionID: string, reportAction: OnyxTypes.Repo
});
}

// added the operation to delete associated transaction violations
if (Permissions.canUseViolations(betas)) {
onyxUpdates.push({
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`,
value: null,
});
}
onyxUpdates.push({
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`,
value: null,
});

// added the operation to delete transaction thread
if (shouldDeleteTransactionThread) {
Expand Down

0 comments on commit 99fb15c

Please sign in to comment.