(int activityId)
| 222 | } |
| 223 | |
| 224 | [HttpDelete("activities/{activityId}")] |
| 225 | public async Task<IActionResult> DeleteComment(int activityId) |
| 226 | { |
| 227 | try |
| 228 | { |
| 229 | int userId = GetUserId(); |
| 230 | var activity = await _taskService.GetActivityByIdAsync(activityId); |
| 231 | if (activity == null) return NotFound(); |
| 232 | |
| 233 | var result = await _taskService.DeleteActivityAsync(activityId, userId); |
| 234 | if (!result) return Forbid(); |
| 235 | |
| 236 | // Notify board |
| 237 | var task = await _taskService.GetTaskByIdAsync(activity.TaskCardId, userId); |
| 238 | if (task != null) |
| 239 | { |
| 240 | await _hubContext.Clients.Group($"board_{task.BoardId}") |
| 241 | .SendAsync("TaskUpdated", task); |
| 242 | } |
| 243 | |
| 244 | return NoContent(); |
| 245 | } |
| 246 | catch (UnauthorizedAccessException) { return Forbid(); } |
| 247 | } |
| 248 | |
| 249 | [HttpPut("activities/{activityId}")] |
| 250 | public async Task<IActionResult> UpdateComment(int activityId, [FromBody] AddCommentDto dto) |
nothing calls this directly
no test coverage detected