From dd3d28c179be1d344f8e3b33705eb1acef3b9611 Mon Sep 17 00:00:00 2001 From: Sarah Roberts Date: Wed, 5 Jun 2024 12:07:24 -0700 Subject: [PATCH] CORE-1999: fix the matching file count when no matching files are found --- src/components/search/utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/search/utils.js b/src/components/search/utils.js index e71a5637b..64587df21 100644 --- a/src/components/search/utils.js +++ b/src/components/search/utils.js @@ -11,5 +11,7 @@ export const getSearchLink = ({ searchTerm = "", advancedDataQuery = "" }) => { }; export const extractTotal = (result) => { - return result?.total?.value || result?.total; + return typeof result?.total === "object" + ? result?.total?.value + : result?.total; };