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

Method CreateSubtask

backend/Controllers/TasksController.cs:125–145  ·  view source on GitHub ↗
(int taskId, [FromBody] CreateSubtaskDto dto)

Source from the content-addressed store, hash-verified

123 }
124
125 [HttpPost("{taskId}/subtasks")]
126 public async Task<IActionResult> CreateSubtask(int taskId, [FromBody] CreateSubtaskDto dto)
127 {
128 try
129 {
130 int userId = GetUserId();
131 var subtask = await _taskService.CreateSubtaskAsync(taskId, dto, userId);
132 if (subtask == null) return NotFound();
133
134 // Hack: We need the boardId to notify the group.
135 var task = await _taskService.GetTaskByIdAsync(taskId, userId);
136 if (task != null)
137 {
138 await _hubContext.Clients.Group($"board_{task.BoardId}")
139 .SendAsync("TaskUpdated", task);
140 }
141
142 return Ok(subtask);
143 }
144 catch (UnauthorizedAccessException) { return Forbid(); }
145 }
146
147 [HttpPut("subtasks/{subtaskId}")]
148 public async Task<IActionResult> UpdateSubtask(int subtaskId, [FromBody] UpdateSubtaskDto dto)

Callers

nothing calls this directly

Calls 2

CreateSubtaskAsyncMethod · 0.45
GetTaskByIdAsyncMethod · 0.45

Tested by

no test coverage detected