Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

494 B
Raw Blame
import type { ProjectWithTasks } from "@/types/project";

export function removeTaskFromProject(
  project: ProjectWithTasks,
  taskId: string,
): ProjectWithTasks {
  return {
    ...project,
    columns: project.columns.map((column) => ({
      ...column,
      tasks: column.tasks.filter((task) => task.id !== taskId),
    })),
    plannedTasks: project.plannedTasks.filter((task) => task.id !== taskId),
    archivedTasks: project.archivedTasks.filter((task) => task.id !== taskId),
  };
}