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

24 lines
492 B
JavaScript
Raw Normal View History

import Polls from '/imports/api/polls';
import { check } from 'meteor/check';
import Logger from '/imports/startup/server/logger';
2017-10-12 08:33:57 +08:00
export default function removePoll(meetingId, id) {
check(meetingId, String);
2017-10-12 08:33:57 +08:00
check(id, String);
const selector = {
meetingId,
2017-10-12 08:33:57 +08:00
id,
};
2017-10-12 08:33:57 +08:00
const cb = (err) => {
2016-10-22 01:42:43 +08:00
if (err) {
return Logger.error(`Removing Poll from collection: ${err}`);
2016-10-22 01:42:43 +08:00
}
return Logger.info(`Removed Poll id=${id}`);
2016-10-22 01:42:43 +08:00
};
return Polls.remove(selector, cb);
2017-06-03 03:25:02 +08:00
}