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

17 lines
440 B
JavaScript
Raw Normal View History

2016-10-21 21:21:09 +08:00
import { check } from 'meteor/check';
import addPoll from '../modifiers/addPoll';
import setPublishedPoll from '../../../meetings/server/modifiers/setPublishedPoll';
2016-10-21 21:21:09 +08:00
2017-10-12 08:33:57 +08:00
export default function pollStarted({ body }, meetingId) {
const { userId } = body;
const { poll } = body;
2016-10-21 21:21:09 +08:00
check(meetingId, String);
2017-10-12 08:33:57 +08:00
check(userId, String);
2016-10-21 21:21:09 +08:00
check(poll, Object);
setPublishedPoll(meetingId, false);
2017-10-12 08:33:57 +08:00
return addPoll(meetingId, userId, poll);
2016-10-21 21:21:09 +08:00
}