Changeset 0.31.2 (#205)
This commit is contained in:
@@ -106,6 +106,12 @@ func (h *WorkflowHandler) Create(c *gin.Context) {
|
||||
|
||||
w.CreatedBy = c.GetString("user_id")
|
||||
|
||||
// v0.31.2: Team-scoped workflow creation (set by CreateTeamWorkflow)
|
||||
if forceTeam, ok := c.Get("force_team_id"); ok {
|
||||
teamID := forceTeam.(string)
|
||||
w.TeamID = &teamID
|
||||
}
|
||||
|
||||
if err := h.stores.Workflows.Create(c.Request.Context(), &w); err != nil {
|
||||
if strings.Contains(err.Error(), "unique") || strings.Contains(err.Error(), "UNIQUE") {
|
||||
c.JSON(http.StatusConflict, gin.H{"error": "slug already exists in this scope"})
|
||||
|
||||
Reference in New Issue
Block a user