fix(board-channels): dev stub slackChannelId must match update schema

The ALLOW_DEV_TEST_ENDPOINTS short-circuit on create wrote
'dev-stub-<ms>' 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.
This commit is contained in:
Jennie Robinson Faber 2026-05-01 12:08:35 +01:00
parent b7d9d91b1a
commit b45f92a574

View file

@ -25,7 +25,9 @@ export default defineEventHandler(async (event) => {
if (!slackChannelId) { if (!slackChannelId) {
if (process.env.ALLOW_DEV_TEST_ENDPOINTS === 'true') { 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 }) console.log('[slack] DEV MODE — skipping createChannel', { name: body.name, slackChannelId })
} else { } else {
const slack = getSlackAdminService() const slack = getSlackAdminService()