kaneo (minimalist kanban) fork to experiment adding a tangled integration
github.com/usekaneo/kaneo
1import { eq } from "drizzle-orm";
2import { HTTPException } from "hono/http-exception";
3import db from "../../database";
4import { workflowRuleTable } from "../../database/schema";
5
6async function deleteWorkflowRule(id: string) {
7 const existing = await db.query.workflowRuleTable.findFirst({
8 where: eq(workflowRuleTable.id, id),
9 });
10
11 if (!existing) {
12 throw new HTTPException(404, { message: "Workflow rule not found" });
13 }
14
15 await db.delete(workflowRuleTable).where(eq(workflowRuleTable.id, id));
16
17 return existing;
18}
19
20export default deleteWorkflowRule;