From 216f5d6603398826e560e8cad386029c60c1470d Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 28 Nov 2020 01:28:29 +0300 Subject: fix: pull data from event context in handler --- src/handlers/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/handlers/index.js') diff --git a/src/handlers/index.js b/src/handlers/index.js index 4e7ee83..ba040fd 100644 --- a/src/handlers/index.js +++ b/src/handlers/index.js @@ -17,7 +17,7 @@ const handleEventAsUser = async (event, browser, user) => { const browserContext = await browser.createIncognitoBrowserContext(); - const { conferenceId } = event; + const { conferenceId } = event.context; const conferenceUrl = `${EDUFPMI_URL}/mod/bigbluebuttonbn/view.php?id=${conferenceId}`; const page = await launchUserSession(user, browserContext); @@ -40,11 +40,11 @@ const handleEventAsUser = async (event, browser, user) => { const handleEvent = async event => { const participants = await UserModel.find({ username: { - $in: event.participants + $in: event.context.participants } }); - event.log('Participants: ', participants.map(participant => participant.username)); + event.log(`Participants: ${participants.map(participant => participant.username)}`); const browser = await puppeteer.launch({ headless, args: ['--no-sandbox', '--incognito'] }); -- cgit v1.2.3