bigbluebutton-Github/bigbluebutton-html5/imports/api/2.0/polls/server/modifiers/removePoll.js

26 lines
569 B
JavaScript
Raw Normal View History

2017-06-29 04:37:45 +08:00
import Polls from '/imports/api/2.0/polls';
import { check } from 'meteor/check';
import Logger from '/imports/startup/server/logger';
export default function removePoll(meetingId, pollId) {
check(meetingId, String);
check(pollId, String);
const selector = {
meetingId,
'poll.id': pollId,
};
const cb = (err, numChanged) => {
if (err) {
2017-06-30 22:26:19 +08:00
return Logger.error(`Removing Poll2x from collection: ${err}`);
2017-06-29 04:37:45 +08:00
}
if (numChanged) {
2017-06-30 22:26:19 +08:00
return Logger.info(`Removed Poll2x id=${pollId}`);
2017-06-29 04:37:45 +08:00
}
};
return Polls.remove(selector, cb);
}