Skip to content

Commit 79952c6

Browse files
committed
Make totalFare optional
1 parent c87c0a2 commit 79952c6

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/libs/TripReservationUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,8 @@ function getTripTotal(tripReport: Report): {
427427
} {
428428
if (tripReport?.tripData?.payload) {
429429
return {
430-
totalDisplaySpend: tripReport.tripData.payload.tripPaymentInfo.totalFare.amount * 100,
431-
currency: tripReport.tripData.payload.tripPaymentInfo.totalFare.currencyCode,
430+
totalDisplaySpend: (tripReport.tripData.payload.tripPaymentInfo?.totalFare?.amount ?? 0) * 100,
431+
currency: tripReport.tripData.payload.tripPaymentInfo?.totalFare?.currencyCode,
432432
};
433433
}
434434

src/types/onyx/TripData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ type TripData = {
55
/**
66
* Information about the payment for the trip, including the total fare.
77
*/
8-
tripPaymentInfo: {
8+
tripPaymentInfo?: {
99
/**
1010
* The total fare for the trip, including the amount and currency code.
1111
*/
12-
totalFare: {
12+
totalFare?: {
1313
/**
1414
* The monetary amount of the total fare.
1515
*/

0 commit comments

Comments
 (0)