From 1e326d01cface8c9223403f7e5367dcda1d4ec25 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Thu, 8 Jul 2021 09:15:12 -0700 Subject: [PATCH 1/2] Fix IOU currency routes --- src/ROUTES.js | 25 ++++++++++++++----------- src/libs/Navigation/linkingConfig.js | 4 ++-- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/ROUTES.js b/src/ROUTES.js index db0f9fb9ec1e..b6f52468b632 100644 --- a/src/ROUTES.js +++ b/src/ROUTES.js @@ -10,6 +10,9 @@ const IOU_REQUEST = 'iou/request'; const IOU_BILL = 'iou/split'; const IOU_SEND = 'iou/send'; const IOU_DETAILS = 'iou/details'; +const IOU_REQUEST_CURRENCY = `${IOU_REQUEST}/:reportID/currency`; +const IOU_BILL_CURRENCY = `${IOU_BILL}/:reportID/currency`; +const IOU_SEND_CURRENCY = `${IOU_SEND}/:reportID/currency`; export default { BANK_ACCOUNT: 'bank-account/:stepToOpen?', @@ -35,17 +38,17 @@ export default { IOU_BILL, IOU_SEND, IOU_REQUEST_WITH_REPORT_ID: `${IOU_REQUEST}/:reportID?`, - IOU_BILL_WITH_REPORTID: `${IOU_BILL}/:reportID?`, - IOU_SEND_WITH_REPORTID: `${IOU_SEND}/:reportID?`, - getIouRequestRoute: reportID => `${IOU_REQUEST}/${reportID}`, - getIouSplitRoute: reportID => `${IOU_BILL}/${reportID}`, - getIOUSendRoute: reportID => `${IOU_SEND}/${reportID}`, - IOU_BILL_CURRENCY: `${IOU_BILL}/:reportID/currency`, - IOU_REQUEST_CURRENCY: `${IOU_REQUEST}/:reportID/currency`, - IOU_SEND_CURRENCY: `${IOU_SEND}/:reportID/currency`, - getIouRequestCurrencyRoute: reportID => `${IOU_REQUEST}/${reportID}/currency`, - getIouBillCurrencyRoute: reportID => `${IOU_BILL}/${reportID}/currency`, - getIouSendCurrencyRoute: reportID => `${IOU_SEND}/${reportID}/currency`, + IOU_BILL_WITH_REPORT_ID: `${IOU_BILL}/:reportID?`, + IOU_SEND_WITH_REPORT_ID: `${IOU_SEND}/:reportID?`, + getIouRequestRoute: reportID => (reportID ? `${IOU_REQUEST}/${reportID}` : IOU_REQUEST), + getIouSplitRoute: reportID => (reportID ? `${IOU_BILL}/${reportID}` : IOU_BILL), + getIOUSendRoute: reportID => (reportID ? `${IOU_SEND}/${reportID}` : IOU_SEND), + IOU_BILL_CURRENCY, + IOU_REQUEST_CURRENCY, + IOU_SEND_CURRENCY, + getIouRequestCurrencyRoute: reportID => (reportID ? `${IOU_REQUEST}/${reportID}/currency` : IOU_REQUEST_CURRENCY), + getIouBillCurrencyRoute: reportID => (reportID ? `${IOU_BILL}/${reportID}/currency` : IOU_BILL_CURRENCY), + getIouSendCurrencyRoute: reportID => (reportID ? `${IOU_SEND}/${reportID}/currency` : IOU_SEND_CURRENCY), IOU_DETAILS, IOU_DETAILS_WITH_IOU_REPORT_ID: `${IOU_DETAILS}/:chatReportID/:iouReportID/`, getIouDetailsRoute: (chatReportID, iouReportID) => `iou/details/${chatReportID}/${iouReportID}`, diff --git a/src/libs/Navigation/linkingConfig.js b/src/libs/Navigation/linkingConfig.js index 3619f6e604d6..14737b4e52dd 100644 --- a/src/libs/Navigation/linkingConfig.js +++ b/src/libs/Navigation/linkingConfig.js @@ -106,13 +106,13 @@ export default { }, IOU_Bill: { screens: { - IOU_Bill_Root: ROUTES.IOU_BILL_WITH_REPORTID, + IOU_Bill_Root: ROUTES.IOU_BILL_WITH_REPORT_ID, IOU_Bill_Currency: ROUTES.IOU_BILL_CURRENCY, }, }, IOU_Send: { screens: { - IOU_Send_Root: ROUTES.IOU_SEND_WITH_REPORTID, + IOU_Send_Root: ROUTES.IOU_SEND_WITH_REPORT_ID, IOU_Send_Currency: ROUTES.IOU_SEND_CURRENCY, }, }, From df8755ceeb68ce49c3b7c15030c6da57828c2b96 Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Thu, 8 Jul 2021 10:29:03 -0700 Subject: [PATCH 2/2] Move optional reportID param to the end of the route' --- src/ROUTES.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/ROUTES.js b/src/ROUTES.js index b6f52468b632..fa62334598da 100644 --- a/src/ROUTES.js +++ b/src/ROUTES.js @@ -10,9 +10,9 @@ const IOU_REQUEST = 'iou/request'; const IOU_BILL = 'iou/split'; const IOU_SEND = 'iou/send'; const IOU_DETAILS = 'iou/details'; -const IOU_REQUEST_CURRENCY = `${IOU_REQUEST}/:reportID/currency`; -const IOU_BILL_CURRENCY = `${IOU_BILL}/:reportID/currency`; -const IOU_SEND_CURRENCY = `${IOU_SEND}/:reportID/currency`; +const IOU_REQUEST_CURRENCY = `${IOU_REQUEST}/currency`; +const IOU_BILL_CURRENCY = `${IOU_BILL}/currency`; +const IOU_SEND_CURRENCY = `${IOU_SEND}/currency`; export default { BANK_ACCOUNT: 'bank-account/:stepToOpen?', @@ -40,15 +40,15 @@ export default { IOU_REQUEST_WITH_REPORT_ID: `${IOU_REQUEST}/:reportID?`, IOU_BILL_WITH_REPORT_ID: `${IOU_BILL}/:reportID?`, IOU_SEND_WITH_REPORT_ID: `${IOU_SEND}/:reportID?`, - getIouRequestRoute: reportID => (reportID ? `${IOU_REQUEST}/${reportID}` : IOU_REQUEST), - getIouSplitRoute: reportID => (reportID ? `${IOU_BILL}/${reportID}` : IOU_BILL), - getIOUSendRoute: reportID => (reportID ? `${IOU_SEND}/${reportID}` : IOU_SEND), - IOU_BILL_CURRENCY, - IOU_REQUEST_CURRENCY, - IOU_SEND_CURRENCY, - getIouRequestCurrencyRoute: reportID => (reportID ? `${IOU_REQUEST}/${reportID}/currency` : IOU_REQUEST_CURRENCY), - getIouBillCurrencyRoute: reportID => (reportID ? `${IOU_BILL}/${reportID}/currency` : IOU_BILL_CURRENCY), - getIouSendCurrencyRoute: reportID => (reportID ? `${IOU_SEND}/${reportID}/currency` : IOU_SEND_CURRENCY), + getIouRequestRoute: reportID => `${IOU_REQUEST}/${reportID}`, + getIouSplitRoute: reportID => `${IOU_BILL}/${reportID}`, + getIOUSendRoute: reportID => `${IOU_SEND}/${reportID}`, + IOU_BILL_CURRENCY: `${IOU_BILL_CURRENCY}/:reportID?`, + IOU_REQUEST_CURRENCY: `${IOU_REQUEST_CURRENCY}/:reportID?`, + IOU_SEND_CURRENCY: `${IOU_SEND_CURRENCY}/:reportID?`, + getIouRequestCurrencyRoute: reportID => `${IOU_REQUEST_CURRENCY}/${reportID}`, + getIouBillCurrencyRoute: reportID => `${IOU_BILL_CURRENCY}/${reportID}`, + getIouSendCurrencyRoute: reportID => `${IOU_SEND_CURRENCY}/${reportID}`, IOU_DETAILS, IOU_DETAILS_WITH_IOU_REPORT_ID: `${IOU_DETAILS}/:chatReportID/:iouReportID/`, getIouDetailsRoute: (chatReportID, iouReportID) => `iou/details/${chatReportID}/${iouReportID}`,