Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(persons): unable to remove assignments
Browse files Browse the repository at this point in the history
rhahao authored Dec 16, 2024
1 parent 974ae5a commit b82e4bf
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
@@ -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();
}
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit b82e4bf

Please sign in to comment.