kaneo (minimalist kanban) fork to experiment adding a tangled integration github.com/usekaneo/kaneo
at main 30 lines 841 B view raw
1import { and, eq } from "drizzle-orm"; 2import { HTTPException } from "hono/http-exception"; 3import db from "../../database"; 4import { integrationTable } from "../../database/schema"; 5 6async function deleteGithubIntegration(projectId: string) { 7 const existingIntegration = await db.query.integrationTable.findFirst({ 8 where: and( 9 eq(integrationTable.projectId, projectId), 10 eq(integrationTable.type, "github"), 11 ), 12 }); 13 14 if (!existingIntegration) { 15 throw new HTTPException(404, { message: "GitHub integration not found" }); 16 } 17 18 await db 19 .delete(integrationTable) 20 .where( 21 and( 22 eq(integrationTable.projectId, projectId), 23 eq(integrationTable.type, "github"), 24 ), 25 ); 26 27 return { success: true, message: "GitHub integration deleted" }; 28} 29 30export default deleteGithubIntegration;