Files
danak-admin/src/pages/taskmanager/task/utils/mapTaskItemToTask.ts
T
hamid zarghami 13781df281
deploy to danak / build_and_deploy (push) Has been cancelled
show attachment in task card and show check list item in task card
2026-07-25 09:20:48 +03:30

18 lines
643 B
TypeScript

import type { Task } from "../../types";
import type { TaskItemType } from "../types/TaskTypes";
export const mapTaskItemToTask = (task: TaskItemType, taskPhaseId: string, fallbackOrder: number): Task => ({
id: task.id,
columnId: task.taskPhaseId ?? taskPhaseId,
order: task.order ?? task.priority ?? fallbackOrder,
title: task.title,
tag: task.tag ?? "",
dateRange: task.dateRange ?? "",
color: task.color || null,
attachments: task.attachmentCount ?? 0,
checklistDone: task.completedCheckListItemCount ?? 0,
checklistTotal: task.checkListItemCount ?? 0,
ticketId: task.ticketId ?? null,
users: task.users ?? [],
});