(int activityId, [FromBody] AddCommentDto dto)
| 247 | } |
| 248 | |
| 249 | [HttpPut("activities/{activityId}")] |
| 250 | public async Task<IActionResult> UpdateComment(int activityId, [FromBody] AddCommentDto dto) |
| 251 | { |
| 252 | try |
| 253 | { |
| 254 | int userId = GetUserId(); |
| 255 | var activity = await _taskService.UpdateActivityAsync(activityId, dto.Text, userId); |
| 256 | if (activity == null) return Forbid(); |
| 257 | |
| 258 | // Notify board |
| 259 | var task = await _taskService.GetTaskByIdAsync(activity.TaskCardId, userId); |
| 260 | if (task != null) |
| 261 | { |
| 262 | await _hubContext.Clients.Group($"board_{task.BoardId}") |
| 263 | .SendAsync("TaskUpdated", task); |
| 264 | } |
| 265 | |
| 266 | return Ok(activity); |
| 267 | } |
| 268 | catch (UnauthorizedAccessException) { return Forbid(); } |
| 269 | } |
| 270 | |
| 271 | [HttpPost("activities/{activityId}/reactions")] |
| 272 | public async Task<IActionResult> ToggleReaction(int activityId, [FromBody] ToggleReactionDto dto) |
nothing calls this directly
no test coverage detected