MCPcopy Create free account
hub / github.com/astercloud/aster / Delete

Method Delete

server/handlers/workflow.go:313–343  ·  view source on GitHub ↗

Delete deletes a workflow

(c *gin.Context)

Source from the content-addressed store, hash-verified

311
312// Delete deletes a workflow
313func (h *WorkflowHandler) Delete(c *gin.Context) {
314 ctx := c.Request.Context()
315 id := c.Param("id")
316
317 if err := (*h.store).Delete(ctx, "workflows", id); err != nil {
318 if errors.Is(err, store.ErrNotFound) {
319 c.JSON(http.StatusNotFound, gin.H{
320 "success": false,
321 "error": gin.H{
322 "code": "not_found",
323 "message": "Workflow not found",
324 },
325 })
326 return
327 }
328 c.JSON(http.StatusInternalServerError, gin.H{
329 "success": false,
330 "error": gin.H{
331 "code": "internal_error",
332 "message": "Failed to delete workflow: " + err.Error(),
333 },
334 })
335 return
336 }
337
338 logging.Info(ctx, "workflow.deleted", map[string]any{
339 "id": id,
340 })
341
342 c.Status(http.StatusNoContent)
343}
344
345// Execute executes a workflow
346func (h *WorkflowHandler) Execute(c *gin.Context) {

Callers

nothing calls this directly

Calls 6

InfoFunction · 0.92
JSONMethod · 0.80
ContextMethod · 0.65
DeleteMethod · 0.65
ErrorMethod · 0.65
StatusMethod · 0.45

Tested by

no test coverage detected