bigbluebutton-Github/bigbluebutton-html5/imports/api/presentations/server/modifiers/removePresentationFromCollection.js
2016-06-27 11:24:37 -07:00

18 lines
682 B
JavaScript
Executable File

import Slides from '/imports/api/slides';
import Presentations from '/imports/api/presentations';
import { logger } from '/imports/startup/server/logger';
export function removePresentationFromCollection(meetingId, presentationId) {
let presentationObject = Presentations.findOne({
meetingId: meetingId,
'presentation.id': presentationId,
});
if (presentationObject != null) {
Slides.remove({
presentationId: presentationId,
}, logger.info(`cleared Slides Collection (presentationId: ${presentationId}!`));
Presentations.remove(presentationObject._id);
return logger.info(`----removed presentation[${presentationId}] from ${meetingId}`);
}
};