bigbluebutton-Github/bigbluebutton-html5/imports/api/whiteboard-multi-user/server/modifiers/clearWhiteboardMultiUser.js

27 lines
777 B
JavaScript

import Logger from '/imports/startup/server/logger';
import WhiteboardMultiUser from '/imports/api/whiteboard-multi-user';
export default function clearWhiteboardMultiUser(meetingId) {
if (meetingId) {
try {
const numberAffected = WhiteboardMultiUser.remove({ meetingId });
if (numberAffected) {
Logger.info(`Cleared WhiteboardMultiUser (${meetingId})`);
}
} catch (err) {
Logger.info(`Error clearing WhiteboardMultiUser (${meetingId}). ${err}`);
}
} else {
try {
const numberAffected = WhiteboardMultiUser.remove({});
if (numberAffected) {
Logger.info('Cleared WhiteboardMultiUser (all)');
}
} catch (err) {
Logger.info(`Error clearing WhiteboardMultiUser (all). ${err}`);
}
}
}