kaneo (minimalist kanban) fork to experiment adding a tangled integration github.com/usekaneo/kaneo
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 38 lines 1.0 kB view raw
1import { eq } from "drizzle-orm"; 2import { HTTPException } from "hono/http-exception"; 3import db from "../../database"; 4import { taskTable, userTable } from "../../database/schema"; 5 6async function getTask(taskId: string) { 7 const task = await db 8 .select({ 9 id: taskTable.id, 10 title: taskTable.title, 11 number: taskTable.number, 12 description: taskTable.description, 13 status: taskTable.status, 14 priority: taskTable.priority, 15 startDate: taskTable.startDate, 16 dueDate: taskTable.dueDate, 17 position: taskTable.position, 18 createdAt: taskTable.createdAt, 19 userId: taskTable.userId, 20 assigneeName: userTable.name, 21 assigneeId: userTable.id, 22 projectId: taskTable.projectId, 23 }) 24 .from(taskTable) 25 .leftJoin(userTable, eq(taskTable.userId, userTable.id)) 26 .where(eq(taskTable.id, taskId)) 27 .limit(1); 28 29 if (!task.length || !task[0]) { 30 throw new HTTPException(404, { 31 message: "Task not found", 32 }); 33 } 34 35 return task[0]; 36} 37 38export default getTask;