bigbluebutton-Github/bigbluebutton-html5/imports/api/2.0/breakouts/server/modifiers/clearBreakouts.js
2017-07-25 10:51:33 -03:00

21 lines
590 B
JavaScript

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