feat: list + task endpoints and CORS, verified end-to-end
This commit is contained in:
23
server/utils/dto.ts
Normal file
23
server/utils/dto.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
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(),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user