feat(board-channels): skip Slack createChannel in dev/test mode
Mirrors the dev-mode short-circuit in invite.post.js. Without SLACK_BOT_TOKEN, board-channel create returned 500 'Slack integration not configured', breaking e2e in CI. With ALLOW_DEV_TEST_ENDPOINTS=true, generate a stub channel ID and proceed; everything DB-side still runs.
This commit is contained in:
parent
6e98720310
commit
1578055a27
1 changed files with 21 additions and 16 deletions
|
|
@ -24,6 +24,10 @@ export default defineEventHandler(async (event) => {
|
||||||
let channelName = body.name
|
let channelName = body.name
|
||||||
|
|
||||||
if (!slackChannelId) {
|
if (!slackChannelId) {
|
||||||
|
if (process.env.ALLOW_DEV_TEST_ENDPOINTS === 'true') {
|
||||||
|
slackChannelId = `dev-stub-${Date.now()}`
|
||||||
|
console.log('[slack] DEV MODE — skipping createChannel', { name: body.name, slackChannelId })
|
||||||
|
} else {
|
||||||
const slack = getSlackAdminService()
|
const slack = getSlackAdminService()
|
||||||
if (!slack) {
|
if (!slack) {
|
||||||
throw createError({
|
throw createError({
|
||||||
|
|
@ -42,6 +46,7 @@ export default defineEventHandler(async (event) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const channel = await BoardChannel.create({
|
const channel = await BoardChannel.create({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue