(int id, [FromBody] List<int> labelIds)
| 294 | } |
| 295 | |
| 296 | [HttpPost("{id}/labels")] |
| 297 | public async Task<IActionResult> SetLabels(int id, [FromBody] List<int> labelIds) |
| 298 | { |
| 299 | try |
| 300 | { |
| 301 | int userId = GetUserId(); |
| 302 | var result = await _taskService.SetTaskLabelsAsync(id, labelIds, userId); |
| 303 | if (!result) return NotFound(); |
| 304 | |
| 305 | var task = await _taskService.GetTaskByIdAsync(id, userId); |
| 306 | if (task != null) |
| 307 | { |
| 308 | await _hubContext.Clients.Group($"board_{task.BoardId}") |
| 309 | .SendAsync("TaskUpdated", task); |
| 310 | } |
| 311 | |
| 312 | return Ok(task); |
| 313 | } |
| 314 | catch (UnauthorizedAccessException) { return Forbid(); } |
| 315 | } |
| 316 | |
| 317 | [HttpPost("{id}/labels/{labelId}")] |
| 318 | public async Task<IActionResult> AddLabel(int id, int labelId) |
nothing calls this directly
no test coverage detected