From 670440364067251e855d0a9cd7a7aad5c5a3a666 Mon Sep 17 00:00:00 2001 From: Huu Le <20178761+huult@users.noreply.github.com> Date: Tue, 24 Dec 2024 23:52:45 +0700 Subject: [PATCH] Update return default customUnitRateID when report ID is undefined --- src/libs/DistanceRequestUtils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/DistanceRequestUtils.ts b/src/libs/DistanceRequestUtils.ts index e69b6754aeb2..94167b382d49 100644 --- a/src/libs/DistanceRequestUtils.ts +++ b/src/libs/DistanceRequestUtils.ts @@ -290,13 +290,14 @@ function convertToDistanceInMeters(distance: number, unit: Unit): number { * Returns custom unit rate ID for the distance transaction */ function getCustomUnitRateID(reportID?: string) { + let customUnitRateID: string = CONST.CUSTOM_UNITS.FAKE_P2P_ID; + if (!reportID) { - return ''; + return customUnitRateID; } const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; const parentReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${report?.parentReportID}`]; const policy = PolicyUtils.getPolicy(report?.policyID ?? parentReport?.policyID); - let customUnitRateID: string = CONST.CUSTOM_UNITS.FAKE_P2P_ID; if (isEmptyObject(policy)) { return customUnitRateID;