taskphase crate and delete
This commit is contained in:
@@ -11,6 +11,7 @@ import Task from "./Task";
|
||||
|
||||
type Props = {
|
||||
column: ColumnType;
|
||||
projectId: string;
|
||||
tasks: TaskType[];
|
||||
draggedTaskId: string | null;
|
||||
draggedColumnId: string | null;
|
||||
@@ -26,6 +27,7 @@ type Props = {
|
||||
|
||||
const Column: FC<Props> = ({
|
||||
column,
|
||||
projectId,
|
||||
tasks,
|
||||
draggedTaskId,
|
||||
draggedColumnId,
|
||||
@@ -129,16 +131,19 @@ const Column: FC<Props> = ({
|
||||
};
|
||||
|
||||
const handleDeleteColumn = () => {
|
||||
deleteTaskPhase.mutate(column.id, {
|
||||
onSuccess: () => {
|
||||
onColumnDeleted?.(column.id);
|
||||
setIsDeleteConfirmOpen(false);
|
||||
toast.success(t("taskmanager.column_deleted"));
|
||||
deleteTaskPhase.mutate(
|
||||
{ id: column.id, projectId },
|
||||
{
|
||||
onSuccess: () => {
|
||||
onColumnDeleted?.(column.id);
|
||||
setIsDeleteConfirmOpen(false);
|
||||
toast.success(t("taskmanager.column_deleted"));
|
||||
},
|
||||
onError: (error: ErrorType) => {
|
||||
toast.error(error.response?.data?.error.message[0]);
|
||||
},
|
||||
},
|
||||
onError: (error: ErrorType) => {
|
||||
toast.error(error.response?.data?.error.message[0]);
|
||||
},
|
||||
});
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user