kaneo (minimalist kanban) fork to experiment adding a tangled integration
github.com/usekaneo/kaneo
1import db from "../../database";
2import { labelTable } from "../../database/schema";
3import { syncLabelToGitHub } from "../../plugins/github/utils/sync-label-to-github";
4
5async function createLabel(
6 name: string,
7 color: string,
8 taskId: string | undefined,
9 workspaceId: string,
10) {
11 const [label] = await db
12 .insert(labelTable)
13 .values({ name, color, taskId, workspaceId })
14 .returning();
15
16 if (taskId) {
17 syncLabelToGitHub(taskId, name, color).catch((error) => {
18 console.error("Failed to sync label to GitHub:", error);
19 });
20 }
21
22 return label;
23}
24
25export default createLabel;