From b45f92a574dd9562f68ed3156d69e8c9c8842461 Mon Sep 17 00:00:00 2001 From: Jennie Robinson Faber Date: Fri, 1 May 2026 12:08:35 +0100 Subject: [PATCH] fix(board-channels): dev stub slackChannelId must match update schema The ALLOW_DEV_TEST_ENDPOINTS short-circuit on create wrote 'dev-stub-' as the channel ID. boardChannelUpdateSchema requires ^[A-Z0-9]+$, so the very next edit on the same channel hit a 400 from Zod and the table never updated. Use base36-uppercased timestamp with a 'CDEV' prefix so the stub survives a round-trip through the patch route. Live path is unchanged. --- server/api/admin/board-channels.post.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/api/admin/board-channels.post.js b/server/api/admin/board-channels.post.js index b49d81f..bc4a9f8 100644 --- a/server/api/admin/board-channels.post.js +++ b/server/api/admin/board-channels.post.js @@ -25,7 +25,9 @@ export default defineEventHandler(async (event) => { if (!slackChannelId) { if (process.env.ALLOW_DEV_TEST_ENDPOINTS === 'true') { - slackChannelId = `dev-stub-${Date.now()}` + // Match the Slack channel ID format (^[A-Z0-9]+$) so the value + // round-trips through boardChannelUpdateSchema on subsequent edits. + slackChannelId = `CDEV${Date.now().toString(36).toUpperCase()}` console.log('[slack] DEV MODE — skipping createChannel', { name: body.name, slackChannelId }) } else { const slack = getSlackAdminService()