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:
parent
b7d9d91b1a
commit
b45f92a574
1 changed files with 3 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue