diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index d4dd69165883b..5701a209a52bd 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -487,7 +487,7 @@ type RequestMoneyInformation = { report: OnyxEntry; participantParams: RequestMoneyParticipantParams; policyParams?: BasePolicyParams; - gpsPoints?: GPSPoint; + gpsPoint?: GPSPoint; action?: IOUAction; transactionParams: RequestMoneyTransactionParams; isRetry?: boolean; @@ -627,7 +627,7 @@ type TrackExpenseTransactionParams = { billable?: boolean; reimbursable?: boolean; validWaypoints?: WaypointCollection; - gpsPoints?: GPSPoint; + gpsPoint?: GPSPoint; actionableWhisperReportActionID?: string; linkedTrackedExpenseReportAction?: OnyxTypes.ReportAction; linkedTrackedExpenseReportID?: string; @@ -6069,7 +6069,7 @@ function requestMoney(requestMoneyInformation: RequestMoneyInformation) { participantParams, policyParams = {}, transactionParams, - gpsPoints, + gpsPoint, action, shouldHandleNavigation = true, backToReport, @@ -6268,7 +6268,7 @@ function requestMoney(requestMoneyInformation: RequestMoneyInformation) { taxAmount, billable, // This needs to be a string of JSON because of limitations with the fetch() API and nested objects - receiptGpsPoints: gpsPoints ? JSON.stringify(gpsPoints) : undefined, + receiptGpsPoints: gpsPoint ? JSON.stringify(gpsPoint) : undefined, transactionThreadReportID, createdReportActionIDForThread, reimbursable, @@ -6526,7 +6526,7 @@ function trackExpense(params: CreateTrackExpenseParams) { taxAmount = 0, billable, reimbursable, - gpsPoints, + gpsPoint, validWaypoints, actionableWhisperReportActionID, linkedTrackedExpenseReportAction, @@ -6567,7 +6567,7 @@ function trackExpense(params: CreateTrackExpenseParams) { taxAmount, billable, validWaypoints, - gpsPoints, + gpsPoint, actionableWhisperReportActionID, linkedTrackedExpenseReportAction, linkedTrackedExpenseReportID, @@ -6774,7 +6774,7 @@ function trackExpense(params: CreateTrackExpenseParams) { taxAmount, billable, // This needs to be a string of JSON because of limitations with the fetch() API and nested objects - receiptGpsPoints: gpsPoints ? JSON.stringify(gpsPoints) : undefined, + receiptGpsPoints: gpsPoint ? JSON.stringify(gpsPoint) : undefined, transactionThreadReportID, createdReportActionIDForThread, waypoints: sanitizedWaypoints, diff --git a/src/pages/Share/SubmitDetailsPage.tsx b/src/pages/Share/SubmitDetailsPage.tsx index f4059862e8df7..d85853c3d3b2b 100644 --- a/src/pages/Share/SubmitDetailsPage.tsx +++ b/src/pages/Share/SubmitDetailsPage.tsx @@ -105,7 +105,7 @@ function SubmitDetailsPage({ const defaultTaxCode = getDefaultTaxCode(policy, transaction); const transactionTaxCode = (transaction?.taxCode ? transaction?.taxCode : defaultTaxCode) ?? ''; - const finishRequestAndNavigate = (participant: Participant, receipt: Receipt, gpsPoints?: GpsPoint) => { + const finishRequestAndNavigate = (participant: Participant, receipt: Receipt, gpsPoint?: GpsPoint) => { if (!transaction) { return; } @@ -141,7 +141,7 @@ function SubmitDetailsPage({ report, participantParams: {payeeEmail: currentUserPersonalDetails.login, payeeAccountID: currentUserPersonalDetails.accountID, participant}, policyParams: {policy, policyTagList: policyTags, policyCategories, policyRecentlyUsedCategories}, - gpsPoints, + gpsPoint, action: CONST.IOU.TYPE.CREATE, transactionParams: { attendees: transaction.comment?.attendees, diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx index 3bedf50e15e22..606c010b3429a 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx @@ -511,7 +511,7 @@ function IOURequestStepConfirmation({ }, [requestType, iouType, initialTransactionID, reportID, action, report, transactions, participants]); const requestMoney = useCallback( - (selectedParticipants: Participant[], gpsPoints?: GpsPoint) => { + (selectedParticipants: Participant[], gpsPoint?: GpsPoint) => { if (!transactions.length) { return; } @@ -554,7 +554,7 @@ function IOURequestStepConfirmation({ policyCategories, policyRecentlyUsedCategories, }, - gpsPoints, + gpsPoint, action, transactionParams: { amount: isTestReceipt ? CONST.TEST_RECEIPT.AMOUNT : item.amount, @@ -673,7 +673,7 @@ function IOURequestStepConfirmation({ ); const trackExpense = useCallback( - (selectedParticipants: Participant[], gpsPoints?: GpsPoint) => { + (selectedParticipants: Participant[], gpsPoint?: GpsPoint) => { if (!transactions.length) { return; } @@ -713,7 +713,7 @@ function IOURequestStepConfirmation({ taxAmount: transactionTaxAmount, billable: item.billable, reimbursable: item.reimbursable, - gpsPoints, + gpsPoint, validWaypoints: Object.keys(item?.comment?.waypoints ?? {}).length ? getValidWaypoints(item.comment?.waypoints, true) : undefined, actionableWhisperReportActionID: item.actionableWhisperReportActionID, linkedTrackedExpenseReportAction: item.linkedTrackedExpenseReportAction, diff --git a/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx b/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx index 4edb03e6db4dc..dbd006d7525ee 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx +++ b/src/pages/iou/request/step/IOURequestStepScan/index.native.tsx @@ -230,7 +230,7 @@ function IOURequestStepScan({ focusIndicatorScale.set(withSpring(1, {damping: 10, stiffness: 200})); focusIndicatorPosition.set(point); - scheduleOnRN(() => focusCamera(point)); + scheduleOnRN(focusCamera, point); }); useFocusEffect( @@ -303,7 +303,7 @@ function IOURequestStepScan({ ( files: ReceiptFile[], participant: Participant, - gpsPoints?: GpsPoint, + gpsPoint?: GpsPoint, policyParams?: { policy: OnyxEntry; }, @@ -331,7 +331,7 @@ function IOURequestStepScan({ receipt, billable, reimbursable, - ...(gpsPoints ?? {}), + gpsPoint, }, ...(policyParams ?? {}), shouldHandleNavigation: index === files.length - 1, @@ -345,7 +345,7 @@ function IOURequestStepScan({ participant, }, ...(policyParams ?? {}), - ...(gpsPoints ?? {}), + gpsPoint, transactionParams: { amount: 0, attendees: transaction?.comment?.attendees, @@ -449,11 +449,11 @@ function IOURequestStepScan({ getCurrentPosition( (successData) => { const policyParams = {policy}; - const gpsPoints = { + const gpsPoint = { lat: successData.coords.latitude, long: successData.coords.longitude, }; - createTransaction(files, participant, gpsPoints, policyParams, false); + createTransaction(files, participant, gpsPoint, policyParams, false); }, (errorData) => { Log.info('[IOURequestStepScan] getCurrentPosition failed', false, errorData); diff --git a/src/pages/iou/request/step/IOURequestStepScan/index.tsx b/src/pages/iou/request/step/IOURequestStepScan/index.tsx index 59fc0554748bc..4a45f7e82761f 100644 --- a/src/pages/iou/request/step/IOURequestStepScan/index.tsx +++ b/src/pages/iou/request/step/IOURequestStepScan/index.tsx @@ -362,7 +362,7 @@ function IOURequestStepScan({ ( files: ReceiptFile[], participant: Participant, - gpsPoints?: GpsPoint, + gpsPoint?: GpsPoint, policyParams?: { policy: OnyxEntry; }, @@ -390,7 +390,7 @@ function IOURequestStepScan({ receipt, billable, reimbursable, - ...(gpsPoints ?? {}), + gpsPoint, }, ...(policyParams ?? {}), shouldHandleNavigation: index === files.length - 1, @@ -404,7 +404,7 @@ function IOURequestStepScan({ participant, }, ...(policyParams ?? {}), - ...(gpsPoints ?? {}), + gpsPoint, transactionParams: { amount: 0, attendees: transaction?.comment?.attendees, @@ -509,11 +509,11 @@ function IOURequestStepScan({ getCurrentPosition( (successData) => { const policyParams = {policy}; - const gpsPoints = { + const gpsPoint = { lat: successData.coords.latitude, long: successData.coords.longitude, }; - createTransaction(files, participant, gpsPoints, policyParams, false, true); + createTransaction(files, participant, gpsPoint, policyParams, false, true); }, (errorData) => { Log.info('[IOURequestStepScan] getCurrentPosition failed', false, errorData);