(int id, int labelId)
| 336 | } |
| 337 | |
| 338 | [HttpDelete("{id}/labels/{labelId}")] |
| 339 | public async Task<IActionResult> RemoveLabel(int id, int labelId) |
| 340 | { |
| 341 | try |
| 342 | { |
| 343 | int userId = GetUserId(); |
| 344 | var result = await _taskService.RemoveLabelFromTaskAsync(id, labelId, userId); |
| 345 | if (!result) return NotFound(); |
| 346 | |
| 347 | var task = await _taskService.GetTaskByIdAsync(id, userId); |
| 348 | if (task != null) |
| 349 | { |
| 350 | await _hubContext.Clients.Group($"board_{task.BoardId}") |
| 351 | .SendAsync("TaskUpdated", task); |
| 352 | } |
| 353 | |
| 354 | return NoContent(); |
| 355 | } |
| 356 | catch (UnauthorizedAccessException) { return Forbid(); } |
| 357 | } |
| 358 | |
| 359 | private int GetUserId() |
| 360 | { |
nothing calls this directly
no test coverage detected