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

Method SetLabels

backend/Controllers/TasksController.cs:296–315  ·  view source on GitHub ↗
(int id, [FromBody] List<int> labelIds)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 2

SetTaskLabelsAsyncMethod · 0.45
GetTaskByIdAsyncMethod · 0.45

Tested by

no test coverage detected