Skip to content

Commit

Permalink
fix(persons): unable to remove assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao committed Dec 16, 2024
1 parent db6f6a1 commit ac34888
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/features/persons/assignments/useAssignments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ const useAssignments = () => {
});
}

if (current && current._deleted !== null) {
current._deleted = null;
if (current && current._deleted) {
current._deleted = false;
}
}
}
Expand All @@ -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();
}
Expand Down Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ac34888

Please sign in to comment.