kaneo (minimalist kanban) fork to experiment adding a tangled integration
github.com/usekaneo/kaneo
1import { and, eq } from "drizzle-orm";
2import { HTTPException } from "hono/http-exception";
3import db from "../../database";
4import { projectTable } from "../../database/schema";
5
6async function getProject(id: string, workspaceId: string) {
7 const project = await db.query.projectTable.findFirst({
8 where: and(
9 eq(projectTable.id, id),
10 eq(projectTable.workspaceId, workspaceId),
11 ),
12 with: {
13 tasks: true,
14 },
15 });
16
17 if (!project) {
18 throw new HTTPException(404, {
19 message: "Project not found",
20 });
21 }
22
23 return project;
24}
25
26export default getProject;