bigbluebutton-Github/bigbluebutton-html5/imports/api/1.1/breakouts/server/modifiers/clearBreakouts.js
2017-06-19 08:57:32 -03:00

21 lines
569 B
JavaScript

import Breakouts from '/imports/api/1.1/breakouts';
import Logger from '/imports/startup/server/logger';
import removeMeeting from '/imports/api/1.1/meetings/server/modifiers/removeMeeting';
export default function clearBreakouts(meetingId) {
if (meetingId) {
const selector = {
breakoutMeetingId: meetingId,
};
const cb = () => {
Logger.info(`Cleared Breakouts (${meetingId})`);
removeMeeting(meetingId);
};
return Breakouts.remove(selector, cb);
}
return Breakouts.remove({}, Logger.info('Cleared Breakouts (all)'));
}