Files
danak-admin/src/pages/taskmanager/task/utils/mapTaskItemToTask.ts
T
hamid zarghami a8830ea70d cursor pagination
2026-07-14 14:52:40 +03:30

16 lines
559 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.attachments ?? 0,
checklistDone: task.checklistDone ?? 0,
checklistTotal: task.checklistTotal ?? 0,
});