bigbluebutton-Github/bigbluebutton-html5/imports/api/external-videos/server/modifiers/stopExternalVideo.js
Pedro Beschorner Marin 72cfc9f86c refactor(external videos): data check
Add missing data check and move the existing ones inside the try-catch
blocks.
2021-06-06 13:13:16 -03:00

19 lines
656 B
JavaScript

import { check } from 'meteor/check';
import Logger from '/imports/startup/server/logger';
import { ExternalVideoMeetings } from '/imports/api/meetings';
export default function stopExternalVideo(userId, meetingId) {
try {
check(meetingId, String);
check(userId, String);
const selector = { meetingId };
const modifier = { $set: { externalVideoUrl: null } };
Logger.info(`External video stop sharing was initiated by:[${userId}] for meeting ${meetingId}`);
ExternalVideoMeetings.update(selector, modifier);
} catch (err) {
Logger.error(`Error on setting shared external video stop in Meetings collection: ${err}`);
}
}