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

24 lines
520 B
JavaScript
Raw Normal View History

import Polls from '/imports/api/polls';
import { check } from 'meteor/check';
import Logger from '/imports/startup/server/logger';
export default async 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,
};
try {
const numberAffected = await Polls.removeAsync(selector);
if (numberAffected) {
Logger.info(`Removed Poll id=${id}`);
}
} catch (err) {
Logger.error(`Removing Poll from collection: ${err}`);
}
2017-06-03 03:25:02 +08:00
}