bigbluebutton-Github/bigbluebutton-html5/imports/api/presentation-pods/server/modifiers/removePresentationPod.js

31 lines
943 B
JavaScript
Raw Normal View History

2018-04-06 04:56:41 +08:00
import { check } from 'meteor/check';
2018-04-06 06:00:52 +08:00
import PresentationPods from '/imports/api/presentation-pods';
2018-04-06 04:56:41 +08:00
import Logger from '/imports/startup/server/logger';
import clearPresentations from '/imports/api/presentations/server/modifiers/clearPresentations';
import clearPresentationUploadToken from '/imports/api/presentation-upload-token/server/modifiers/clearPresentationUploadToken';
2018-04-06 04:56:41 +08:00
export default function removePresentationPod(meetingId, podId) {
check(meetingId, String);
check(podId, String);
const selector = {
meetingId,
podId,
};
const cb = (err) => {
if (err) {
Logger.error(`Removing presentation pod from collection: ${err}`);
return;
}
if (podId) {
Logger.info(`Removed presentation pod id=${podId} meeting=${meetingId}`);
clearPresentations(meetingId, podId);
clearPresentationUploadToken(meetingId, podId);
2018-04-06 04:56:41 +08:00
}
};
return PresentationPods.remove(selector, cb);
}