bigbluebutton-Github/bigbluebutton-html5/imports/api/presentations/server/modifiers/addPresentationToCollection.js
2016-05-16 13:05:44 -05:00

26 lines
815 B
JavaScript
Executable File

import Presentations from '/imports/api/presentations';
export function addPresentationToCollection(meetingId, presentationObject) {
let entry, id, presentationObj;
//check if the presentation is already in the collection
presentationObj = Presentations.findOne({
meetingId: meetingId,
'presentation.id': presentationObject.id,
});
if (presentationObj == null) {
entry = {
meetingId: meetingId,
presentation: {
id: presentationObject.id,
name: presentationObject.name,
current: presentationObject.current,
},
};
return id = Presentations.insert(entry);
//logger.info "presentation added id =[#{id}]:#{presentationObject.id} in #{meetingId}.
// Presentations.size is now #{Presentations.find({meetingId: meetingId}).count()}"
}
};