Skip to content

Commit

Permalink
Fix some ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
neil-marcellini committed Oct 15, 2024
1 parent 817266b commit a2f0074
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libs/DistanceRequestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ function getTaxableAmount(policy: OnyxEntry<Policy>, customUnitRateID: string, d
return amount * taxClaimablePercentage;
}

function getDistanceUnit(transaction: OnyxEntry<Transaction>, mileageRate: OnyxEntry<MileageRate>) {
function getDistanceUnit(transaction: OnyxEntry<Transaction>, mileageRate: OnyxEntry<MileageRate>): Unit {
return transaction?.comment?.customUnit?.distanceUnit ?? mileageRate?.unit ?? CONST.CUSTOM_UNITS.DISTANCE_UNIT_MILES;
}

Expand Down
3 changes: 2 additions & 1 deletion src/types/onyx/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type ONYXKEYS from '@src/ONYXKEYS';
import type CollectionDataSet from '@src/types/utils/CollectionDataSet';
import type {Participant, Split} from './IOU';
import type * as OnyxCommon from './OnyxCommon';
import type {Unit} from './Policy';
import type RecentWaypoint from './RecentWaypoint';
import type ReportAction from './ReportAction';
import type {ViolationName} from './TransactionViolation';
Expand Down Expand Up @@ -102,7 +103,7 @@ type TransactionCustomUnit = {
defaultP2PRate?: number | null;

/** The unit for the distance/quantity */
distanceUnit?: 'mi' | 'km';
distanceUnit?: Unit;
};

/** Types of geometry */
Expand Down

0 comments on commit a2f0074

Please sign in to comment.