@@ -90,14 +90,12 @@ const ROUTES = {
9090 backTo,
9191 moneyRequestReportActionID,
9292 transactionID,
93- iouReportID,
9493 } : {
9594 reportID : string | undefined ;
9695 reportActionID ?: string ;
9796 backTo ?: string ;
9897 moneyRequestReportActionID ?: string ;
9998 transactionID ?: string ;
100- iouReportID ?: string ;
10199 } ) => {
102100 if ( ! reportID ) {
103101 Log . warn ( 'Invalid reportID is used to build the SEARCH_REPORT route' ) ;
@@ -114,10 +112,6 @@ const ROUTES = {
114112 queryParams . push ( `moneyRequestReportActionID=${ moneyRequestReportActionID } ` ) ;
115113 }
116114
117- if ( iouReportID ) {
118- queryParams . push ( `iouReportID=${ iouReportID } ` ) ;
119- }
120-
121115 const queryString = queryParams . length > 0 ? ( `${ baseRoute } ?${ queryParams . join ( '&' ) } ` as const ) : baseRoute ;
122116 return getUrlWithBackToParam ( queryString , backTo ) ;
123117 } ,
@@ -392,19 +386,10 @@ const ROUTES = {
392386 REPORT : 'r' ,
393387 REPORT_WITH_ID : {
394388 route : 'r/:reportID?/:reportActionID?' ,
395- getRoute : (
396- reportID : string | undefined ,
397- reportActionID ?: string ,
398- referrer ?: string ,
399- moneyRequestReportActionID ?: string ,
400- transactionID ?: string ,
401- backTo ?: string ,
402- iouReportID ?: string ,
403- ) => {
389+ getRoute : ( reportID : string | undefined , reportActionID ?: string , referrer ?: string , moneyRequestReportActionID ?: string , transactionID ?: string , backTo ?: string ) => {
404390 if ( ! reportID ) {
405391 Log . warn ( 'Invalid reportID is used to build the REPORT_WITH_ID route' ) ;
406392 }
407-
408393 const baseRoute = reportActionID ? ( `r/${ reportID } /${ reportActionID } ` as const ) : ( `r/${ reportID } ` as const ) ;
409394
410395 const queryParams : string [ ] = [ ] ;
@@ -418,10 +403,6 @@ const ROUTES = {
418403 queryParams . push ( `transactionID=${ transactionID } ` ) ;
419404 }
420405
421- if ( iouReportID ) {
422- queryParams . push ( `iouReportID=${ iouReportID } ` ) ;
423- }
424-
425406 const queryString = queryParams . length > 0 ? `?${ queryParams . join ( '&' ) } ` : '' ;
426407
427408 return getUrlWithBackToParam ( `${ baseRoute } ${ queryString } ` as const , backTo ) ;
@@ -599,15 +580,10 @@ const ROUTES = {
599580 } ,
600581 MONEY_REQUEST_HOLD_REASON : {
601582 route : ':type/edit/reason/:transactionID?/:searchHash?' ,
602- getRoute : ( type : ValueOf < typeof CONST . POLICY . TYPE > , transactionID : string , reportID : string | undefined , backTo : string , searchHash ?: number ) => {
603- let route = searchHash
604- ? ( `${ type as string } /edit/reason/${ transactionID } /${ searchHash } /?backTo=${ backTo } ` as const )
605- : ( `${ type as string } /edit/reason/${ transactionID } /?backTo=${ backTo } ` as const ) ;
606-
607- if ( reportID ) {
608- route = `${ route } &reportID=${ reportID } ` as const ;
609- }
610-
583+ getRoute : ( type : ValueOf < typeof CONST . POLICY . TYPE > , transactionID : string , reportID : string , backTo : string , searchHash ?: number ) => {
584+ const route = searchHash
585+ ? ( `${ type as string } /edit/reason/${ transactionID } /${ searchHash } /?backTo=${ backTo } &reportID=${ reportID } ` as const )
586+ : ( `${ type as string } /edit/reason/${ transactionID } /?backTo=${ backTo } &reportID=${ reportID } ` as const ) ;
611587 return route ;
612588 } ,
613589 } ,
0 commit comments