(int id, int labelId)
| 315 | } |
| 316 | |
| 317 | [HttpPost("{id}/labels/{labelId}")] |
| 318 | public async Task<IActionResult> AddLabel(int id, int labelId) |
| 319 | { |
| 320 | try |
| 321 | { |
| 322 | int userId = GetUserId(); |
| 323 | var result = await _taskService.AddLabelToTaskAsync(id, labelId, userId); |
| 324 | if (!result) return NotFound(); |
| 325 | |
| 326 | var task = await _taskService.GetTaskByIdAsync(id, userId); |
| 327 | if (task != null) |
| 328 | { |
| 329 | await _hubContext.Clients.Group($"board_{task.BoardId}") |
| 330 | .SendAsync("TaskUpdated", task); |
| 331 | } |
| 332 | |
| 333 | return Ok(task); |
| 334 | } |
| 335 | catch (UnauthorizedAccessException) { return Forbid(); } |
| 336 | } |
| 337 | |
| 338 | [HttpDelete("{id}/labels/{labelId}")] |
| 339 | public async Task<IActionResult> RemoveLabel(int id, int labelId) |
nothing calls this directly
no test coverage detected