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

Method DeleteSubtask

backend/Controllers/TasksController.cs:169–193  ·  view source on GitHub ↗
(int subtaskId)

Source from the content-addressed store, hash-verified

167 }
168
169 [HttpDelete("subtasks/{subtaskId}")]
170 public async Task<IActionResult> DeleteSubtask(int subtaskId)
171 {
172 try
173 {
174 int userId = GetUserId();
175 // Fetch subtask before deletion to get TaskCardId for SignalR
176 var subtask = await _taskService.GetSubtaskByIdAsync(subtaskId);
177 if (subtask == null) return NotFound();
178
179 var result = await _taskService.DeleteSubtaskAsync(subtaskId, userId);
180 if (!result) return NotFound();
181
182 // Notify board
183 var task = await _taskService.GetTaskByIdAsync(subtask.TaskCardId, userId);
184 if (task != null)
185 {
186 await _hubContext.Clients.Group($"board_{task.BoardId}")
187 .SendAsync("TaskUpdated", task);
188 }
189
190 return NoContent();
191 }
192 catch (UnauthorizedAccessException) { return Forbid(); }
193 }
194
195 [HttpGet("{taskId}/activities")]
196 public async Task<IActionResult> GetTaskActivities(int taskId)

Callers

nothing calls this directly

Calls 3

GetSubtaskByIdAsyncMethod · 0.45
DeleteSubtaskAsyncMethod · 0.45
GetTaskByIdAsyncMethod · 0.45

Tested by

no test coverage detected