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

20 lines
406 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';
2017-10-12 08:33:57 +08:00
export default function pollStopped({ body }, meetingId) {
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);
2016-10-22 01:42:43 +08:00
return removePoll(meetingId, pollId);
}
return clearPolls(meetingId);
2016-10-21 21:21:09 +08:00
}