bigbluebutton-Github/bigbluebutton-html5/imports/api/polls/server/handlers/pollStopped.js

24 lines
478 B
JavaScript
Raw Normal View History

2016-10-21 21:21:09 +08:00
import { check } from 'meteor/check';
import removePoll from '../modifiers/removePoll';
2016-10-21 21:21:09 +08:00
import clearPolls from '../modifiers/clearPolls';
export default async function pollStopped({ body }, meetingId) {
2017-10-12 08:33:57 +08:00
const { poll } = body;
2016-10-21 21:21:09 +08:00
check(meetingId, String);
if (poll) {
2017-10-12 08:33:57 +08:00
const { pollId } = poll;
check(pollId, String);
const result = await removePoll(meetingId, pollId);
return result;
}
const result = await clearPolls(meetingId);
return result;
2016-10-21 21:21:09 +08:00
}