feat: list + task endpoints and CORS, verified end-to-end

This commit is contained in:
2026-06-10 07:58:51 +00:00
parent 394bceca5f
commit 285bac4308
11 changed files with 143 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
// GET /api/lists/:id/tasks (web) — Idle tasks for a list. 404 if the list is unknown.
export default defineEventHandler(async (event) => {
const id = getRouterParam(event, "id")!;
const sql = getSql();
if (!(await listExists(sql, id))) {
throw createError({ statusCode: 404, statusMessage: "list not found" });
}
const rows = await getTasksForList(sql, id);
return rows.map(toTaskDto);
});