Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix(task): validate assignee existence on task creation

(justin)randoneeringb0133ee01b03
diff --git a/apps/api/src/task/controllers/create-task.ts b/apps/api/src/task/controllers/create-task.ts
index b66825f7e..f4d0c675c 100644
--- a/apps/api/src/task/controllers/create-task.ts
+++ b/apps/api/src/task/controllers/create-task.ts
@@ -37,6 +37,12 @@ async function createTask({
.from(userTable)
.where(eq(userTable.id, userId ?? ""));
+ if (userId && !assignee) {
+ throw new HTTPException(404, {
+ message: "Assignee not found",
+ });
+ }
+
const column = await db.query.columnTable.findFirst({
where: and(
eq(columnTable.projectId, projectId),