Skip to content

Commit cbbe399

Browse files
committed
fix: Fix Status not updating when moved in the grid
1 parent d0b848c commit cbbe399

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

apps/api/src/task/controllers/update-task.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async function updateTask(
4545
});
4646
}
4747

48-
return updatedTask;
48+
return existingTask;
4949
}
5050

5151
export default updateTask;

apps/api/src/task/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,19 @@ const task = new Hono<{
112112
userId,
113113
);
114114

115+
if(status !== task.status) {
116+
const user = c.get("userId");
117+
await publishEvent("task.status_changed", {
118+
taskId: task.id,
119+
userId: user,
120+
oldStatus: task.status,
121+
newStatus: status,
122+
title: task.title,
123+
type: "status_changed",
124+
});
125+
}
126+
127+
115128
return c.json(task);
116129
},
117130
)

0 commit comments

Comments
 (0)