kaneo (minimalist kanban) fork to experiment adding a tangled integration
github.com/usekaneo/kaneo
1import { HTTPException } from "hono/http-exception";
2import db from "../../database";
3import { commentTable } from "../../database/schema";
4
5async function createComment(taskId: string, userId: string, content: string) {
6 const [comment] = await db
7 .insert(commentTable)
8 .values({
9 taskId,
10 userId,
11 content,
12 })
13 .returning();
14
15 if (!comment) {
16 throw new HTTPException(500, { message: "Failed to create comment" });
17 }
18
19 return comment;
20}
21
22export default createComment;