From 31b0a44f8075493da19a9887f0a2800818e93836 Mon Sep 17 00:00:00 2001 From: Georgii Karataev Date: Wed, 22 Mar 2023 13:15:50 +0100 Subject: [PATCH] fix: Fix the CI error related to lastSeen filter This adds a fallback value for lastSeenFilter object which appears to be undefined or null in some CI tests. --- src/routes/InventoryTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/InventoryTable.js b/src/routes/InventoryTable.js index 2bd4c3488..aa1bc7f1b 100644 --- a/src/routes/InventoryTable.js +++ b/src/routes/InventoryTable.js @@ -49,7 +49,7 @@ const filterMapper = { ), rhcdFilter: ({ rhcdFilter }, searchParams) => rhcdFilter?.forEach(item => searchParams.append(RHCD_FILTER_KEY, item)), lastSeenFilter: ({ lastSeenFilter }, searchParams) => - Object.keys(lastSeenFilter)?.forEach(item => item === 'mark' && + Object.keys(lastSeenFilter || {})?.forEach(item => item === 'mark' && searchParams.append('last_seen', lastSeenFilter[item])), updateMethodFilter: ({ updateMethodFilter }, searchParams) => updateMethodFilter?.forEach(item => searchParams.append(UPDATE_METHOD_KEY, item)),