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

27 lines
799 B
JavaScript

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