Skip to content

Commit

Permalink
Merge pull request Expensify#35540 from dukenv0307/fix/35236
Browse files Browse the repository at this point in the history
fix IOU with category can be created when admin disable the same category
  • Loading branch information
Gonals authored Feb 14, 2024
2 parents 88c66c0 + 04d3ae9 commit e6c321f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/pages/iou/request/step/IOURequestStepConfirmation.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ function IOURequestStepConfirmation({
IOU.setMoneyRequestBillable_temporaryForRefactor(transactionID, defaultBillable);
}, [transactionID, defaultBillable]);

useEffect(() => {
if (!transaction.category) {
return;
}
if (policyCategories[transaction.category] && !policyCategories[transaction.category].enabled) {
IOU.resetMoneyRequestCategory_temporaryForRefactor(transactionID);
}
}, [policyCategories, transaction.category, transactionID]);
const defaultCategory = lodashGet(
_.find(lodashGet(policy, 'customUnits', {}), (customUnit) => customUnit.name === CONST.CUSTOM_UNITS.NAME_DISTANCE),
'defaultCategory',
Expand Down

0 comments on commit e6c321f

Please sign in to comment.