fix: Account for no text param passed to hooks.slack

This will never happen in production, Slack always provides the param but prevents a possible 500 server error when messing with the API manually.
This commit is contained in:
Tom Moor
2020-03-22 16:41:15 -07:00
committed by GitHub
parent 7a6ed86c95
commit 4b3ddf8769

View File

@ -99,7 +99,7 @@ router.post('hooks.interactive', async ctx => {
// triggered by the /outline command in Slack
router.post('hooks.slack', async ctx => {
const { token, team_id, user_id, text } = ctx.body;
const { token, team_id, user_id, text = "" } = ctx.body;
ctx.assertPresent(token, 'token is required');
ctx.assertPresent(team_id, 'team_id is required');
ctx.assertPresent(user_id, 'user_id is required');