(int activityId, [FromBody] ToggleReactionDto dto)
| 269 | } |
| 270 | |
| 271 | [HttpPost("activities/{activityId}/reactions")] |
| 272 | public async Task<IActionResult> ToggleReaction(int activityId, [FromBody] ToggleReactionDto dto) |
| 273 | { |
| 274 | try |
| 275 | { |
| 276 | int userId = GetUserId(); |
| 277 | var reaction = await _taskService.ToggleReactionAsync(activityId, dto.Emoji, userId); |
| 278 | |
| 279 | // Notify board so reactions sync in real-time |
| 280 | var activity = await _taskService.GetActivityByIdAsync(activityId); |
| 281 | if (activity != null) |
| 282 | { |
| 283 | var task = await _taskService.GetTaskByIdAsync(activity.TaskCardId, userId); |
| 284 | if (task != null) |
| 285 | { |
| 286 | await _hubContext.Clients.Group($"board_{task.BoardId}") |
| 287 | .SendAsync("TaskUpdated", task); |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | return Ok(reaction); |
| 292 | } |
| 293 | catch (UnauthorizedAccessException) { return Forbid(); } |
| 294 | } |
| 295 | |
| 296 | [HttpPost("{id}/labels")] |
| 297 | public async Task<IActionResult> SetLabels(int id, [FromBody] List<int> labelIds) |
nothing calls this directly
no test coverage detected