bigbluebutton-Github/bigbluebutton-html5/imports/api/presentations/server/modifiers/removePresentationFromCollection.js

18 lines
682 B
JavaScript
Raw Normal View History

2016-05-17 02:05:44 +08:00
import Slides from '/imports/api/slides';
import Presentations from '/imports/api/presentations';
2016-05-13 01:43:59 +08:00
import { logger } from '/imports/startup/server/logger';
export function removePresentationFromCollection(meetingId, presentationId) {
2016-06-28 02:24:37 +08:00
let presentationObject = Presentations.findOne({
2016-05-16 22:35:59 +08:00
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}`);
}
2016-05-13 01:43:59 +08:00
};