Changeset 0.28.0.1 (#173)
This commit is contained in:
@@ -61,7 +61,11 @@ func (h *WorkflowHandler) List(c *gin.Context) {
|
||||
func (h *WorkflowHandler) Get(c *gin.Context) {
|
||||
w, err := h.stores.Workflows.GetByID(c.Request.Context(), c.Param("id"))
|
||||
if err != nil {
|
||||
c.JSON(http.StatusNotFound, gin.H{"error": "workflow not found"})
|
||||
if err == sql.ErrNoRows {
|
||||
c.JSON(http.StatusNotFound, gin.H{"error": "workflow not found"})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "failed to get workflow: " + err.Error()})
|
||||
return
|
||||
}
|
||||
stages, _ := h.stores.Workflows.ListStages(c.Request.Context(), w.ID)
|
||||
@@ -251,7 +255,11 @@ func (h *WorkflowHandler) Publish(c *gin.Context) {
|
||||
wfID := c.Param("id")
|
||||
w, err := h.stores.Workflows.GetByID(c.Request.Context(), wfID)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusNotFound, gin.H{"error": "workflow not found"})
|
||||
if err == sql.ErrNoRows {
|
||||
c.JSON(http.StatusNotFound, gin.H{"error": "workflow not found"})
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "failed to get workflow: " + err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user