fix
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/descrybe/descrybe-v2/apps/api/internal/processing"
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
@@ -66,7 +65,7 @@ func (s *Server) mountV1(r chi.Router) {
|
||||
// Not an alias of POST/GET /process (flat ProcessingJob).
|
||||
r.Post("/products/process", s.handleV1StartProcess)
|
||||
r.Get("/products/process/{id}", s.handleV1GetProcess)
|
||||
r.Get("/products/{id}", s.handleGetProduct)
|
||||
r.Get("/products/{id}", s.handleV1GetProduct)
|
||||
r.Patch("/products/{id}", s.handleUpdateProduct)
|
||||
|
||||
// Content calendar — separate from email /api/campaigns (session UI).
|
||||
@@ -79,7 +78,7 @@ func (s *Server) mountV1(r chi.Router) {
|
||||
r.Get("/categories", s.handleV1ListCategories)
|
||||
r.Post("/categories", s.handleV1CreateCategory)
|
||||
r.Post("/categories/create", s.handleV1CreateCategory) // legacy alias
|
||||
r.Get("/categories/{id}", s.handleGetCategory)
|
||||
r.Get("/categories/{id}", s.handleV1GetCategory)
|
||||
r.Patch("/categories/{id}", s.handleUpdateCategory)
|
||||
r.Delete("/categories/{id}", s.handleV1DeleteCategory)
|
||||
|
||||
@@ -113,7 +112,7 @@ func (s *Server) mountV1(r chi.Router) {
|
||||
// Dashboard-style jobs (flat JSON / 202). Prefer /products/process for legacy integrations.
|
||||
r.Post("/process", s.handleStartProcessingJob)
|
||||
r.Get("/process", s.handleV1ListProcessJobs)
|
||||
r.Get("/process/{id}", s.handleGetProcessingJob)
|
||||
r.Get("/process/{id}", s.handleV1GetProcessJob)
|
||||
r.Post("/process/{id}/cancel", s.handleCancelProcessingJob)
|
||||
r.Post("/process/{id}/terminate", s.handleCancelProcessingJob)
|
||||
r.Post("/process/{id}/retry", s.handleRetryProcessingJob)
|
||||
@@ -133,7 +132,7 @@ func (s *Server) handleV1ListProcessJobs(w http.ResponseWriter, r *http.Request)
|
||||
Error(w, http.StatusInternalServerError, "list failed")
|
||||
return
|
||||
}
|
||||
JSON(w, http.StatusOK, map[string]any{"jobs": processing.FormatListJobsResponse(items), "limit": limit})
|
||||
JSON(w, http.StatusOK, map[string]any{"jobs": presentV1JobList(items), "limit": limit})
|
||||
}
|
||||
|
||||
func (s *Server) handleV1OpenAPI(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user