From 17c09edc4fbac23a8670afc9272f99661f63a7a7 Mon Sep 17 00:00:00 2001 From: hobokenchicken Date: Thu, 2 Jul 2026 08:30:09 -0400 Subject: [PATCH] fix: channel PATCH was nulling group_id on name-only updates group_id = without COALESCE wrote NULL when only name was sent, orphaning the channel from its group. --- internal/channel/handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/channel/handlers.go b/internal/channel/handlers.go index 5600420..d8d5644 100644 --- a/internal/channel/handlers.go +++ b/internal/channel/handlers.go @@ -366,7 +366,7 @@ func (h *Handler) Update(w http.ResponseWriter, r *http.Request) { category = COALESCE($3, category), position = COALESCE($4, position), slowmode_seconds = COALESCE($5, slowmode_seconds), - group_id = $7 + group_id = COALESCE($7, group_id) WHERE id = $6 RETURNING id, server_id, name, type, category, position, slowmode_seconds, group_id, created_at `, req.Name, req.Type, req.Category, req.Position, req.SlowmodeSeconds, channelID, req.GroupID).Scan(