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: Fix Status not updating when moved in the grid (#638)

Samb51af1a5f4c8
diff --git a/apps/api/src/task/controllers/update-task.ts b/apps/api/src/task/controllers/update-task.ts
index 819d726b9..25053545e 100644
--- a/apps/api/src/task/controllers/update-task.ts
+++ b/apps/api/src/task/controllers/update-task.ts
@@ -45,7 +45,7 @@ async function updateTask(
});
}
- return updatedTask;
+ return existingTask;
}
export default updateTask;
diff --git a/apps/api/src/task/index.ts b/apps/api/src/task/index.ts
index 6275d3d98..d690a4de3 100644
--- a/apps/api/src/task/index.ts
+++ b/apps/api/src/task/index.ts
@@ -112,6 +112,19 @@ const task = new Hono<{
userId,
);
+ if(status !== task.status) {
+ const user = c.get("userId");
+ await publishEvent("task.status_changed", {
+ taskId: task.id,
+ userId: user,
+ oldStatus: task.status,
+ newStatus: status,
+ title: task.title,
+ type: "status_changed",
+ });
+ }
+
+
return c.json(task);
},
)