Files
claudedo-online/server/utils/dto.ts

24 lines
482 B
TypeScript

import type { TaskRow } from "./repo";
export interface TaskDto {
id: string;
listId: string;
title: string;
description: string | null;
source: string;
consumed: boolean;
createdAt: string;
}
export function toTaskDto(row: TaskRow): TaskDto {
return {
id: row.id,
listId: row.list_id,
title: row.title,
description: row.description,
source: row.source,
consumed: row.consumed,
createdAt: new Date(row.created_at).toISOString(),
};
}