From c21543a3c5e530cbc66ea559052fe6699178810c Mon Sep 17 00:00:00 2001 From: 5war00p Date: Wed, 18 Oct 2023 23:21:16 +0530 Subject: [PATCH 1/3] revert: from empty string to null --- src/pages/home/ReportScreen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 4903ab2160a5..3c8203f9b868 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -127,7 +127,7 @@ const defaultProps = { * @returns {String} */ function getReportID(route) { - return String(lodashGet(route, 'params.reportID', '')); + return String(lodashGet(route, 'params.reportID', null)); } function ReportScreen({ From 0ee0cefc5bcfed34ad95bcf0b8eef44a8ac5d558 Mon Sep 17 00:00:00 2001 From: 5war00p Date: Wed, 18 Oct 2023 23:35:57 +0530 Subject: [PATCH 2/3] chore: added comment for null --- src/pages/home/ReportScreen.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 3c8203f9b868..9235d3196b5d 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -127,6 +127,7 @@ const defaultProps = { * @returns {String} */ function getReportID(route) { + // reportID shouldn't be empty string as null says Onyx to return empty object return String(lodashGet(route, 'params.reportID', null)); } From d26e3003f49fad8f360bece8572009806767dc1c Mon Sep 17 00:00:00 2001 From: Swaroop Date: Thu, 19 Oct 2023 00:32:43 +0530 Subject: [PATCH 3/3] docs: update report id to be null w.r.to onyx Co-authored-by: Fedi Rajhi --- src/pages/home/ReportScreen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 9235d3196b5d..ef16dc067719 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -127,7 +127,7 @@ const defaultProps = { * @returns {String} */ function getReportID(route) { - // reportID shouldn't be empty string as null says Onyx to return empty object + // // The reportID is used inside a collection key and should not be empty, as an empty reportID will result in the entire collection being returned. return String(lodashGet(route, 'params.reportID', null)); }