26 lines
535 B
TypeScript
26 lines
535 B
TypeScript
import type { TaskRow } from "./repo";
|
|
|
|
export interface TaskDto {
|
|
id: string;
|
|
listId: string;
|
|
title: string;
|
|
description: string | null;
|
|
source: string;
|
|
consumed: boolean;
|
|
ownerId: string | null;
|
|
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,
|
|
ownerId: row.owner_id,
|
|
createdAt: new Date(row.created_at).toISOString(),
|
|
};
|
|
}
|