MCPcopy Create free account
hub / github.com/GmpABR/NexusFlow / AddLabel

Method AddLabel

backend/Controllers/TasksController.cs:317–336  ·  view source on GitHub ↗
(int id, int labelId)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 2

AddLabelToTaskAsyncMethod · 0.45
GetTaskByIdAsyncMethod · 0.45

Tested by

no test coverage detected