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

Method ToggleReaction

backend/Controllers/TasksController.cs:271–294  ·  view source on GitHub ↗
(int activityId, [FromBody] ToggleReactionDto dto)

Source from the content-addressed store, hash-verified

269 }
270
271 [HttpPost("activities/{activityId}/reactions")]
272 public async Task<IActionResult> ToggleReaction(int activityId, [FromBody] ToggleReactionDto dto)
273 {
274 try
275 {
276 int userId = GetUserId();
277 var reaction = await _taskService.ToggleReactionAsync(activityId, dto.Emoji, userId);
278
279 // Notify board so reactions sync in real-time
280 var activity = await _taskService.GetActivityByIdAsync(activityId);
281 if (activity != null)
282 {
283 var task = await _taskService.GetTaskByIdAsync(activity.TaskCardId, userId);
284 if (task != null)
285 {
286 await _hubContext.Clients.Group($"board_{task.BoardId}")
287 .SendAsync("TaskUpdated", task);
288 }
289 }
290
291 return Ok(reaction);
292 }
293 catch (UnauthorizedAccessException) { return Forbid(); }
294 }
295
296 [HttpPost("{id}/labels")]
297 public async Task<IActionResult> SetLabels(int id, [FromBody] List<int> labelIds)

Callers

nothing calls this directly

Calls 3

ToggleReactionAsyncMethod · 0.45
GetActivityByIdAsyncMethod · 0.45
GetTaskByIdAsyncMethod · 0.45

Tested by

no test coverage detected