From 4179aefa17e913448e377d1f6f1a0133178bd367 Mon Sep 17 00:00:00 2001 From: "Aditya @ArchLinux" <132184385+adityadeshlahre@users.noreply.github.com> Date: Fri, 6 Dec 2024 23:22:01 +0530 Subject: [PATCH] fix:testMenuList rendering fix --- .../TestNotificationConfigMenu.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/admin/testNotificationConfigMenu/TestNotificationConfigMenu.js b/frontend/src/components/admin/testNotificationConfigMenu/TestNotificationConfigMenu.js index 0cad171f13..6ef6f8e534 100644 --- a/frontend/src/components/admin/testNotificationConfigMenu/TestNotificationConfigMenu.js +++ b/frontend/src/components/admin/testNotificationConfigMenu/TestNotificationConfigMenu.js @@ -58,7 +58,7 @@ function TestNotificationConfigMenu() { const componentMounted = useRef(false); const [page, setPage] = useState(1); - const [pageSize, setPageSize] = useState(20); + const [pageSize, setPageSize] = useState(25); const [loading, setLoading] = useState(true); const [saveButton, setSaveButton] = useState(true); const [testNamesList, setTestNamesList] = useState([]); @@ -170,7 +170,7 @@ function TestNotificationConfigMenu() { setTestNotificationConfigMenuDataPost((prevData) => { const updatedMenuList = prevData.menuList.map((item) => { - if (item.id === rowId) { + if (item.testId === rowId) { switch (header) { case "patientEmail": return { @@ -225,9 +225,13 @@ function TestNotificationConfigMenu() { return ( item.testId === row.id, + )?.[cell.info.header]?.active || false + } onChange={(e) => { setSaveButton(false); handleCheckboxChange(e, row.id, cell.info.header); @@ -304,7 +308,7 @@ function TestNotificationConfigMenu() { testNotificationConfigMenuDataPost?.menuList ?.slice((page - 1) * pageSize, page * pageSize) ?.map((item) => ({ - id: item.id, + id: item.testId, testId: item.testId, patientEmail: item.patientEmail.active ? "true" : "false", patientSMS: item.patientSMS.active ? "true" : "false",