fix: accept workflow_enabled in channel settings API request

The UpdateSettings handler was missing workflow_enabled from the
request struct, so PUT /api/channels/{name}/settings could not
enable/disable workflow mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Algis Dumbris
2026-03-18 11:30:11 +02:00
co-authored by Claude Opus 4.6
parent 4de779d30b
commit 3830fba728
+5
View File
@@ -327,6 +327,7 @@ func (h *ChannelsHandler) UpdateSettings(w http.ResponseWriter, r *http.Request)
}
var req struct {
WorkflowEnabled *bool `json:"workflow_enabled"`
AutoApprove *bool `json:"auto_approve"`
StalemateRemindAfter *string `json:"stalemate_remind_after"`
StalemateEscalateAfter *string `json:"stalemate_escalate_after"`
@@ -338,11 +339,15 @@ func (h *ChannelsHandler) UpdateSettings(w http.ResponseWriter, r *http.Request)
}
settings := channels.ChannelSettings{
WorkflowEnabled: ch.WorkflowEnabled,
AutoApprove: ch.AutoApprove,
StalemateRemindAfter: ch.StalemateRemindAfter,
StalemateEscalateAfter: ch.StalemateEscalateAfter,
}
if req.WorkflowEnabled != nil {
settings.WorkflowEnabled = *req.WorkflowEnabled
}
if req.AutoApprove != nil {
settings.AutoApprove = *req.AutoApprove
}