From 825dbcdfa405245d9b0f94e74c18cbba59176de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Olek=C5=A1=C3=A1k?= Date: Thu, 7 Jul 2022 16:23:04 +0200 Subject: [PATCH] fix: Fix exclude/include from Systems table row actions (#1719) --- src/Helpers/CVEHelper.js | 2 +- src/Helpers/CVEHelper.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Helpers/CVEHelper.js b/src/Helpers/CVEHelper.js index c15f5ceca..a2eb18b3b 100644 --- a/src/Helpers/CVEHelper.js +++ b/src/Helpers/CVEHelper.js @@ -193,7 +193,7 @@ export const systemTableRowActions = (rowData, optOutFunc) => [ : ), onClick: (event, rowId, rowData) => { - optOutFunc({ [rowData.id]: true }, rowData.display_name, !rowData.opt_out); + optOutFunc([rowData], rowData.display_name, !rowData.opt_out); } } ]; diff --git a/src/Helpers/CVEHelper.test.js b/src/Helpers/CVEHelper.test.js index 2f968d052..db75c55c7 100644 --- a/src/Helpers/CVEHelper.test.js +++ b/src/Helpers/CVEHelper.test.js @@ -263,6 +263,6 @@ describe('CVEHelper', () => { const rawData = { id: 'testId', display_name: 'testName', opt_out: true }; const actions = systemTableRowActions(rawData, optOutFunc); actions[0].onClick(null, null, rawData); - expect((optOutFunc)).toHaveBeenCalledWith({ testId: true }, 'testName', false); + expect((optOutFunc)).toHaveBeenCalledWith([{"display_name": "testName", "id": "testId", "opt_out": true}], 'testName', false); }) });