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

23 lines
468 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 function pollStopped({ payload }) {
check(payload, Object);
const meetingId = payload.meeting_id;
const poll = payload.poll;
2016-10-21 21:21:09 +08:00
check(meetingId, String);
if (poll) {
const pollId = poll.id;
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
}