From ac348884f8af02fa9662b7bad790f9c486e2c1f4 Mon Sep 17 00:00:00 2001 From: "Rasamoelina, Haja Onjatiana" <26148770+rhahao@users.noreply.github.com> Date: Mon, 16 Dec 2024 07:11:40 +0000 Subject: [PATCH] fix(persons): unable to remove assignments --- src/features/persons/assignments/useAssignments.tsx | 9 +++++---- .../month_item/useMonthItem.tsx | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/features/persons/assignments/useAssignments.tsx b/src/features/persons/assignments/useAssignments.tsx index cb467e06a7..2dc566abe2 100644 --- a/src/features/persons/assignments/useAssignments.tsx +++ b/src/features/persons/assignments/useAssignments.tsx @@ -157,8 +157,8 @@ const useAssignments = () => { }); } - if (current && current._deleted !== null) { - current._deleted = null; + if (current && current._deleted) { + current._deleted = false; } } } @@ -169,7 +169,8 @@ const useAssignments = () => { const current = newPerson.person_data.assignments.find( (record) => record.code === item.code ); - if (current && current._deleted === false) { + + if (current && !current._deleted) { current._deleted = true; current.updatedAt = new Date().toISOString(); } @@ -240,7 +241,7 @@ const useAssignments = () => { const current = newPerson.person_data.assignments.find( (record) => record.code === code ); - if (current && current._deleted === false) { + if (current && !current._deleted) { current._deleted = true; current.updatedAt = new Date().toISOString(); } diff --git a/src/features/reports/publisher_records_details/month_item/useMonthItem.tsx b/src/features/reports/publisher_records_details/month_item/useMonthItem.tsx index 8dc24a4379..e9a111e575 100644 --- a/src/features/reports/publisher_records_details/month_item/useMonthItem.tsx +++ b/src/features/reports/publisher_records_details/month_item/useMonthItem.tsx @@ -90,7 +90,6 @@ const useMonthItem = ({ month, person }: MonthItemProps) => { }, [month]); const not_publisher = useMemo(() => { - console.log(month, first_report); if (!first_report || first_report?.length === 0) return true; if (month < first_report) return true;