summaryrefslogtreecommitdiff
path: root/internal/api/stories.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/stories.go')
-rw-r--r--internal/api/stories.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/api/stories.go b/internal/api/stories.go
index 629ea7a..1743dbe 100644
--- a/internal/api/stories.go
+++ b/internal/api/stories.go
@@ -322,6 +322,17 @@ func (s *Server) handleApproveStory(w http.ResponseWriter, r *http.Request) {
})
}
+// handleShipStory triggers the merge + deploy for a SHIPPABLE story.
+// POST /api/stories/{id}/ship
+func (s *Server) handleShipStory(w http.ResponseWriter, r *http.Request) {
+ id := r.PathValue("id")
+ if err := s.pool.ShipStory(r.Context(), id); err != nil {
+ writeJSON(w, http.StatusConflict, map[string]string{"error": err.Error()})
+ return
+ }
+ writeJSON(w, http.StatusAccepted, map[string]string{"message": "story shipping initiated", "story_id": id})
+}
+
// handleStoryDeploymentStatus aggregates the deployment status across all tasks in a story.
// GET /api/stories/{id}/deployment-status
func (s *Server) handleStoryDeploymentStatus(w http.ResponseWriter, r *http.Request) {