Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"test:debug": "TZ=utc NODE_OPTIONS='--inspect-brk --experimental-vm-modules' jest --runInBand",
"perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure",
"typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc",
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=111 --cache --cache-location=node_modules/.cache/eslint --cache-strategy content --concurrency=auto",
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=110 --cache --cache-location=node_modules/.cache/eslint --cache-strategy content --concurrency=auto",
"lint-changed": "NODE_OPTIONS=--max_old_space_size=8192 ./scripts/lintChanged.sh",
"check-lazy-loading": "ts-node scripts/checkLazyLoading.ts",
"lint-watch": "npx eslint-watch --watch --changed",
Expand Down
107 changes: 56 additions & 51 deletions src/libs/actions/IOU/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@
type BasePolicyParams = {
policy?: OnyxEntry<OnyxTypes.Policy>;
policyTagList?: OnyxEntry<OnyxTypes.PolicyTagLists>;
policyRecentlyUsedTags?: OnyxEntry<RecentlyUsedTags>;
policyCategories?: OnyxEntry<OnyxTypes.PolicyCategories>;
policyRecentlyUsedCategories?: OnyxEntry<OnyxTypes.RecentlyUsedCategories>;
};
Expand Down Expand Up @@ -637,6 +638,7 @@
existingSplitChatReportID?: string;
transactionParams: CreateSplitsTransactionParams;
policyRecentlyUsedCategories?: OnyxEntry<OnyxTypes.RecentlyUsedCategories>;
policyRecentlyUsedTags: OnyxEntry<RecentlyUsedTags>;
isASAPSubmitBetaEnabled: boolean;
transactionViolations: OnyxCollection<OnyxTypes.TransactionViolation[]>;
quickAction: OnyxEntry<OnyxTypes.QuickAction>;
Expand Down Expand Up @@ -752,7 +754,7 @@
};

let allPersonalDetails: OnyxTypes.PersonalDetailsList = {};
Onyx.connect({

Check warning on line 757 in src/libs/actions/IOU/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
allPersonalDetails = value ?? {};
Expand All @@ -775,6 +777,7 @@
taxAmount: number;
shouldPlaySound?: boolean;
policyRecentlyUsedCategories?: OnyxEntry<OnyxTypes.RecentlyUsedCategories>;
policyRecentlyUsedTags: OnyxEntry<RecentlyUsedTags>;
quickAction: OnyxEntry<OnyxTypes.QuickAction>;
policyRecentlyUsedCurrencies: string[];
};
Expand Down Expand Up @@ -848,7 +851,7 @@
};

let allTransactions: NonNullable<OnyxCollection<OnyxTypes.Transaction>> = {};
Onyx.connect({

Check warning on line 854 in src/libs/actions/IOU/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -862,7 +865,7 @@
});

let allTransactionDrafts: NonNullable<OnyxCollection<OnyxTypes.Transaction>> = {};
Onyx.connect({

Check warning on line 868 in src/libs/actions/IOU/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION_DRAFT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -871,7 +874,7 @@
});

let allTransactionViolations: NonNullable<OnyxCollection<OnyxTypes.TransactionViolations>> = {};
Onyx.connect({

Check warning on line 877 in src/libs/actions/IOU/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -885,7 +888,7 @@
});

let allNextSteps: NonNullable<OnyxCollection<OnyxTypes.ReportNextStepDeprecated>> = {};
Onyx.connect({

Check warning on line 891 in src/libs/actions/IOU/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.NEXT_STEP,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -893,18 +896,8 @@
},
});

// TODO: remove `allRecentlyUsedTags` from this file (https://github.com/Expensify/App/issues/71491)
// `allRecentlyUsedTags` was moved here temporarily from `src/libs/actions/Policy/Tag.ts` during the `Deprecate Onyx.connect` refactor.
// All uses of this variable should be replaced with `useOnyx`.
let allRecentlyUsedTags: OnyxCollection<RecentlyUsedTags> = {};
Onyx.connect({
key: ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_TAGS,
waitForCollectionCallback: true,
callback: (val) => (allRecentlyUsedTags = val),
});

let allReports: OnyxCollection<OnyxTypes.Report>;
Onyx.connect({

Check warning on line 900 in src/libs/actions/IOU/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -913,7 +906,7 @@
});

let allReportNameValuePairs: OnyxCollection<OnyxTypes.ReportNameValuePairs>;
Onyx.connect({

Check warning on line 909 in src/libs/actions/IOU/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -923,7 +916,7 @@

let userAccountID = -1;
let currentUserEmail = '';
Onyx.connect({

Check warning on line 919 in src/libs/actions/IOU/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
currentUserEmail = value?.email ?? '';
Expand All @@ -932,7 +925,7 @@
});

let deprecatedCurrentUserPersonalDetails: OnyxEntry<OnyxTypes.PersonalDetails>;
Onyx.connect({

Check warning on line 928 in src/libs/actions/IOU/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
deprecatedCurrentUserPersonalDetails = value?.[userAccountID] ?? undefined;
Expand All @@ -941,7 +934,7 @@

let deprecatedQuickAction: OnyxEntry<OnyxTypes.QuickAction> = {};
// eslint-disable-next-line @typescript-eslint/no-deprecated
Onyx.connect({

Check warning on line 937 in src/libs/actions/IOU/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NVP_QUICK_ACTION_GLOBAL_CREATE,
callback: (value) => {
deprecatedQuickAction = value;
Expand Down Expand Up @@ -982,14 +975,6 @@
callback: (val) => (recentWaypoints = val ?? []),
});

/**
* @deprecated This function uses Onyx.connect and should be replaced with useOnyx for reactive data access.
* All usages of this function should be replaced with useOnyx hook in React components.
*/
function getPolicyRecentlyUsedTagsData(policyID: string | undefined) {
return allRecentlyUsedTags?.[`${ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_TAGS}${policyID}`] ?? {};
}

/**
* @private
* After finishing the action in RHP from the Inbox tab, besides dismissing the modal, we should open the report.
Expand Down Expand Up @@ -3367,6 +3352,7 @@
companyName?: string;
companyWebsite?: string;
policyRecentlyUsedCategories?: OnyxEntry<OnyxTypes.RecentlyUsedCategories>;
policyRecentlyUsedTags?: OnyxEntry<OnyxTypes.RecentlyUsedTags>;
};

/** Gathers all the data needed to create an invoice. */
Expand All @@ -3382,6 +3368,7 @@
companyName,
companyWebsite,
policyRecentlyUsedCategories,
policyRecentlyUsedTags,
}: SendInvoiceOptions): SendInvoiceInformation {
const {amount = 0, currency = '', created = '', merchant = '', category = '', tag = '', taxCode = '', taxAmount = 0, billable, comment, participants} = transaction ?? {};
const trimmedComment = (comment?.comment ?? '').trim();
Expand Down Expand Up @@ -3438,9 +3425,7 @@
const optimisticPolicyRecentlyUsedCategories = mergePolicyRecentlyUsedCategories(category, policyRecentlyUsedCategories);
const optimisticPolicyRecentlyUsedTags = buildOptimisticPolicyRecentlyUsedTags({
policyTags: getPolicyTagsData(optimisticInvoiceReport.policyID),
// TODO: Replace getPolicyRecentlyUsedTagsData with useOnyx hook (https://github.com/Expensify/App/issues/71491)
// eslint-disable-next-line @typescript-eslint/no-deprecated
policyRecentlyUsedTags: getPolicyRecentlyUsedTagsData(optimisticInvoiceReport.policyID),
policyRecentlyUsedTags,
transactionTags: tag,
});
const optimisticRecentlyUsedCurrencies = mergePolicyRecentlyUsedCurrencies(currency, policyRecentlyUsedCurrencies);
Expand Down Expand Up @@ -3548,7 +3533,7 @@
transactionViolations,
} = moneyRequestInformation;
const {payeeAccountID = userAccountID, payeeEmail = currentUserEmail, participant} = participantParams;
const {policy, policyCategories, policyTagList, policyRecentlyUsedCategories} = policyParams;
const {policy, policyCategories, policyTagList, policyRecentlyUsedCategories, policyRecentlyUsedTags} = policyParams;
const {
attendees,
amount,
Expand Down Expand Up @@ -3691,9 +3676,7 @@
const optimisticPolicyRecentlyUsedCategories = mergePolicyRecentlyUsedCategories(category, policyRecentlyUsedCategories);
const optimisticPolicyRecentlyUsedTags = buildOptimisticPolicyRecentlyUsedTags({
policyTags: getPolicyTagsData(iouReport.policyID),
// TODO: Replace getPolicyRecentlyUsedTagsData with useOnyx hook (https://github.com/Expensify/App/issues/71491)
// eslint-disable-next-line @typescript-eslint/no-deprecated
policyRecentlyUsedTags: getPolicyRecentlyUsedTagsData(iouReport.policyID),
policyRecentlyUsedTags,
transactionTags: tag,
});
// eslint-disable-next-line @typescript-eslint/no-deprecated
Expand Down Expand Up @@ -3935,7 +3918,7 @@
policyRecentlyUsedCurrencies,
} = perDiemExpenseInformation;
const {payeeAccountID = userAccountID, payeeEmail = currentUserEmail, participant} = participantParams;
const {policy, policyCategories, policyTagList, policyRecentlyUsedCategories} = policyParams;
const {policy, policyCategories, policyTagList, policyRecentlyUsedCategories, policyRecentlyUsedTags} = policyParams;
const {destinations: recentlyUsedDestinations} = recentlyUsedParams;
const {comment = '', currency, created, category, tag, customUnit, billable, attendees, reimbursable} = transactionParams;

Expand Down Expand Up @@ -4028,9 +4011,7 @@
const optimisticPolicyRecentlyUsedCategories = mergePolicyRecentlyUsedCategories(category, policyRecentlyUsedCategories);
const optimisticPolicyRecentlyUsedTags = buildOptimisticPolicyRecentlyUsedTags({
policyTags: getPolicyTagsData(iouReport.policyID),
// TODO: Replace getPolicyRecentlyUsedTagsData with useOnyx hook (https://github.com/Expensify/App/issues/71491)
// eslint-disable-next-line @typescript-eslint/no-deprecated
policyRecentlyUsedTags: getPolicyRecentlyUsedTagsData(iouReport.policyID),
policyRecentlyUsedTags,
transactionTags: tag,
});
const optimisticPolicyRecentlyUsedCurrencies = mergePolicyRecentlyUsedCurrencies(currency, policyRecentlyUsedCurrencies);
Expand Down Expand Up @@ -4493,6 +4474,7 @@
transactionChanges: TransactionChanges;
policy: OnyxEntry<OnyxTypes.Policy>;
policyTagList: OnyxTypes.OnyxInputOrEntry<OnyxTypes.PolicyTagLists>;
policyRecentlyUsedTags?: OnyxEntry<RecentlyUsedTags>;
policyCategories: OnyxTypes.OnyxInputOrEntry<OnyxTypes.PolicyCategories>;
policyRecentlyUsedCategories?: OnyxEntry<OnyxTypes.RecentlyUsedCategories>;
violations?: OnyxEntry<OnyxTypes.TransactionViolations>;
Expand All @@ -4512,6 +4494,7 @@
transactionChanges,
policy,
policyTagList,
policyRecentlyUsedTags,
policyCategories,
policyRecentlyUsedCategories,
violations,
Expand Down Expand Up @@ -4814,9 +4797,7 @@
if (hasModifiedTag) {
const optimisticPolicyRecentlyUsedTags = buildOptimisticPolicyRecentlyUsedTags({
policyTags: getPolicyTagsData(iouReport?.policyID),
// TODO: Replace getPolicyRecentlyUsedTagsData with useOnyx hook (https://github.com/Expensify/App/issues/71491)
// eslint-disable-next-line @typescript-eslint/no-deprecated
policyRecentlyUsedTags: getPolicyRecentlyUsedTagsData(iouReport?.policyID),
policyRecentlyUsedTags,
transactionTags: transactionChanges.tag,
});
if (!isEmptyObject(optimisticPolicyRecentlyUsedTags)) {
Expand Down Expand Up @@ -5422,19 +5403,34 @@
API.write(WRITE_COMMANDS.UPDATE_MONEY_REQUEST_ATTENDEES, params, onyxData);
}

type UpdateMoneyRequestTagParams = {
transactionID: string;
transactionThreadReportID: string | undefined;
tag: string;
policy: OnyxEntry<OnyxTypes.Policy>;
policyTagList: OnyxEntry<OnyxTypes.PolicyTagLists>;
policyRecentlyUsedTags: OnyxEntry<RecentlyUsedTags>;
policyCategories: OnyxEntry<OnyxTypes.PolicyCategories>;
currentUserAccountIDParam: number;
currentUserEmailParam: string;
isASAPSubmitBetaEnabled: boolean;
hash?: number;
};

/** Updates the tag of an expense */
function updateMoneyRequestTag(
transactionID: string,
transactionThreadReportID: string | undefined,
tag: string,
policy: OnyxEntry<OnyxTypes.Policy>,
policyTagList: OnyxEntry<OnyxTypes.PolicyTagLists>,
policyCategories: OnyxEntry<OnyxTypes.PolicyCategories>,
currentUserAccountIDParam: number,
currentUserEmailParam: string,
isASAPSubmitBetaEnabled: boolean,
hash?: number,
) {
function updateMoneyRequestTag({
transactionID,
transactionThreadReportID,
tag,
policy,
policyTagList,
policyRecentlyUsedTags,
policyCategories,
currentUserAccountIDParam,
currentUserEmailParam,
isASAPSubmitBetaEnabled,
hash,
}: UpdateMoneyRequestTagParams) {
const transactionChanges: TransactionChanges = {
tag,
};
Expand All @@ -5444,6 +5440,7 @@
transactionChanges,
policy,
policyTagList,
policyRecentlyUsedTags,
policyCategories,
hash,
currentUserAccountIDParam,
Expand Down Expand Up @@ -6708,6 +6705,7 @@
companyName,
companyWebsite,
policyRecentlyUsedCategories,
policyRecentlyUsedTags,
}: SendInvoiceOptions) {
const parsedComment = getParsedComment(transaction?.comment?.comment?.trim() ?? '');
if (transaction?.comment) {
Expand Down Expand Up @@ -6739,6 +6737,7 @@
companyName,
companyWebsite,
policyRecentlyUsedCategories,
policyRecentlyUsedTags,
});

const parameters: SendInvoiceParams = {
Expand Down Expand Up @@ -7253,6 +7252,7 @@
attendees,
},
policyRecentlyUsedCategories,
policyRecentlyUsedTags,
isASAPSubmitBetaEnabled,
transactionViolations,
quickAction,
Expand Down Expand Up @@ -7630,9 +7630,7 @@
const optimisticPolicyRecentlyUsedTags = isPolicyExpenseChat
? buildOptimisticPolicyRecentlyUsedTags({
policyTags: getPolicyTagsData(participant.policyID),
// TODO: Replace getPolicyRecentlyUsedTagsData with useOnyx hook (https://github.com/Expensify/App/issues/71491)
// eslint-disable-next-line @typescript-eslint/no-deprecated
policyRecentlyUsedTags: getPolicyRecentlyUsedTagsData(participant.policyID),
policyRecentlyUsedTags,
transactionTags: tag,
})
: {};
Expand Down Expand Up @@ -7744,6 +7742,7 @@
taxAmount?: number;
isRetry?: boolean;
policyRecentlyUsedCategories?: OnyxEntry<OnyxTypes.RecentlyUsedCategories>;
policyRecentlyUsedTags: OnyxEntry<RecentlyUsedTags>;
isASAPSubmitBetaEnabled: boolean;
transactionViolations: OnyxCollection<OnyxTypes.TransactionViolation[]>;
quickAction: OnyxEntry<OnyxTypes.QuickAction>;
Expand Down Expand Up @@ -7777,6 +7776,7 @@
transactionViolations,
quickAction,
policyRecentlyUsedCurrencies,
policyRecentlyUsedTags,
}: SplitBillActionsParams) {
const parsedComment = getParsedComment(comment);
const {splitData, splits, onyxData} = createSplitsAndOnyxData({
Expand All @@ -7800,6 +7800,7 @@
taxAmount,
},
policyRecentlyUsedCategories,
policyRecentlyUsedTags,
isASAPSubmitBetaEnabled,
transactionViolations,
quickAction,
Expand Down Expand Up @@ -7860,6 +7861,7 @@
taxAmount = 0,
existingSplitChatReportID,
policyRecentlyUsedCategories,
policyRecentlyUsedTags,
isASAPSubmitBetaEnabled,
transactionViolations,
quickAction,
Expand Down Expand Up @@ -7888,6 +7890,7 @@
taxAmount,
},
policyRecentlyUsedCategories,
policyRecentlyUsedTags,
transactionViolations,
quickAction,
policyRecentlyUsedCurrencies,
Expand Down Expand Up @@ -7945,6 +7948,7 @@
taxAmount = 0,
shouldPlaySound = true,
policyRecentlyUsedCategories,
policyRecentlyUsedTags,
quickAction,
policyRecentlyUsedCurrencies,
}: StartSplitBilActionParams) {
Expand Down Expand Up @@ -8117,6 +8121,7 @@
taxAmount,
quickAction,
policyRecentlyUsedCurrencies,
policyRecentlyUsedTags,
};

if (existingSplitChatReport) {
Expand Down Expand Up @@ -8211,9 +8216,7 @@
const optimisticPolicyRecentlyUsedCategories = mergePolicyRecentlyUsedCategories(category, policyRecentlyUsedCategories);
const optimisticPolicyRecentlyUsedTags = buildOptimisticPolicyRecentlyUsedTags({
policyTags: getPolicyTagsData(participant.policyID),
// TODO: Replace getPolicyRecentlyUsedTagsData with useOnyx hook (https://github.com/Expensify/App/issues/71491)
// eslint-disable-next-line @typescript-eslint/no-deprecated
policyRecentlyUsedTags: getPolicyRecentlyUsedTagsData(participant.policyID),
policyRecentlyUsedTags,
transactionTags: tag,
});
const optimisticRecentlyUsedCurrencies = mergePolicyRecentlyUsedCurrencies(currency, policyRecentlyUsedCurrencies);
Expand Down Expand Up @@ -8610,7 +8613,7 @@
quickAction,
policyRecentlyUsedCurrencies,
} = distanceRequestInformation;
const {policy, policyCategories, policyTagList, policyRecentlyUsedCategories} = policyParams;
const {policy, policyCategories, policyTagList, policyRecentlyUsedCategories, policyRecentlyUsedTags} = policyParams;
const parsedComment = getParsedComment(transactionParams.comment);
transactionParams.comment = parsedComment;
const {
Expand Down Expand Up @@ -8675,6 +8678,7 @@
attendees,
},
policyRecentlyUsedCategories,
policyRecentlyUsedTags,
isASAPSubmitBetaEnabled,
transactionViolations,
quickAction,
Expand Down Expand Up @@ -8732,6 +8736,7 @@
policyCategories,
policyTagList,
policyRecentlyUsedCategories,
policyRecentlyUsedTags,
},
transactionParams: {
amount,
Expand Down
4 changes: 2 additions & 2 deletions src/libs/actions/Policy/Tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function openPolicyTagsPage(policyID: string) {

type BuildOptimisticPolicyRecentlyUsedTagsProps = {
policyTags: PolicyTagLists;
policyRecentlyUsedTags: RecentlyUsedTags;
policyRecentlyUsedTags: OnyxEntry<RecentlyUsedTags>;
transactionTags?: string;
};

Expand All @@ -83,7 +83,7 @@ function buildOptimisticPolicyRecentlyUsedTags({policyTags, policyRecentlyUsedTa
}

const tagListKey = policyTagKeys.at(index) ?? '';
newOptimisticPolicyRecentlyUsedTags[tagListKey] = [...new Set([tag, ...(policyRecentlyUsedTags[tagListKey] ?? [])])];
newOptimisticPolicyRecentlyUsedTags[tagListKey] = [...new Set([tag, ...(policyRecentlyUsedTags?.[tagListKey] ?? [])])];
}

return newOptimisticPolicyRecentlyUsedTags;
Expand Down
3 changes: 2 additions & 1 deletion src/pages/Share/SubmitDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function SubmitDetailsPage({
const [currentDate] = useOnyx(ONYXKEYS.CURRENT_DATE, {canBeMissing: true});
const [validFilesToUpload] = useOnyx(ONYXKEYS.VALIDATED_FILE_OBJECT, {canBeMissing: true});
const [policyRecentlyUsedCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_CATEGORIES}${getIOURequestPolicyID(transaction, report)}`, {canBeMissing: true});
const [policyRecentlyUsedTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_TAGS}${getIOURequestPolicyID(transaction, report)}`, {canBeMissing: true});
const [currentAttachment] = useOnyx(ONYXKEYS.SHARE_TEMP_FILE, {canBeMissing: true});
const shouldUsePreValidatedFile = shouldValidateFile(currentAttachment);
const isLinkedTrackedExpenseReportArchived = useReportIsArchived(transaction?.linkedTrackedExpenseReportID);
Expand Down Expand Up @@ -150,7 +151,7 @@ function SubmitDetailsPage({
requestMoney({
report,
participantParams: {payeeEmail: currentUserPersonalDetails.login, payeeAccountID: currentUserPersonalDetails.accountID, participant},
policyParams: {policy, policyTagList: policyTags, policyCategories, policyRecentlyUsedCategories},
policyParams: {policy, policyTagList: policyTags, policyCategories, policyRecentlyUsedCategories, policyRecentlyUsedTags},
gpsPoint,
action: CONST.IOU.TYPE.CREATE,
transactionParams: {
Expand Down
2 changes: 2 additions & 0 deletions src/pages/iou/request/step/IOURequestStepCompanyInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function IOURequestStepCompanyInfo({route, report, transaction}: IOURequestStepC
const policy = usePolicy(policyID);
const [policyRecentlyUsedCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_CATEGORIES}${policyID}`, {canBeMissing: true});
const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`, {canBeMissing: true});
const [policyRecentlyUsedTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_TAGS}${policyID}`, {canBeMissing: true});
const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`, {canBeMissing: true});
const [policyRecentlyUsedCurrencies] = useOnyx(ONYXKEYS.RECENTLY_USED_CURRENCIES, {canBeMissing: true});

Expand Down Expand Up @@ -86,6 +87,7 @@ function IOURequestStepCompanyInfo({route, report, transaction}: IOURequestStepC
companyName: values.companyName,
companyWebsite,
policyRecentlyUsedCategories,
policyRecentlyUsedTags,
});
};

Expand Down
Loading
Loading