2016-11-14 19:57:10 +08:00
|
|
|
import Breakouts from '/imports/api/breakouts';
|
|
|
|
import Logger from '/imports/startup/server/logger';
|
2016-11-22 23:46:08 +08:00
|
|
|
import removeMeeting from '/imports/api/meetings/server/modifiers/removeMeeting';
|
2016-11-14 19:57:10 +08:00
|
|
|
|
2016-11-17 23:20:40 +08:00
|
|
|
export default function clearBreakouts(meetingId) {
|
|
|
|
if (meetingId) {
|
2016-11-25 03:22:04 +08:00
|
|
|
const selector = {
|
2016-11-17 23:20:40 +08:00
|
|
|
breakoutMeetingId: meetingId,
|
2016-11-25 03:22:04 +08:00
|
|
|
};
|
|
|
|
|
2016-11-29 03:48:02 +08:00
|
|
|
const cb = () => {
|
2016-11-22 23:46:08 +08:00
|
|
|
Logger.info(`Cleared Breakouts (${meetingId})`);
|
|
|
|
removeMeeting(meetingId);
|
2016-11-25 03:22:04 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
return Breakouts.remove(selector, cb);
|
2016-11-17 23:20:40 +08:00
|
|
|
}
|
|
|
|
|
2017-06-03 03:25:02 +08:00
|
|
|
return Breakouts.remove({}, Logger.info('Cleared Breakouts (all)'));
|
2016-11-14 19:57:10 +08:00
|
|
|
}
|