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

20 lines
522 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, poll, pollType, question,
} = 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);
check(pollType, String);
check(question, String);
2016-10-21 21:21:09 +08:00
setPublishedPoll(meetingId, false);
return addPoll(meetingId, userId, poll, pollType, question);
2016-10-21 21:21:09 +08:00
}