2016-10-21 21:21:09 +08:00
|
|
|
import { check } from 'meteor/check';
|
|
|
|
import addPoll from '../modifiers/addPoll';
|
2019-05-22 22:44:17 +08:00
|
|
|
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) {
|
2020-09-21 20:07:36 +08:00
|
|
|
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);
|
2020-09-21 20:07:36 +08:00
|
|
|
check(pollType, String);
|
|
|
|
check(question, String);
|
2016-10-21 21:21:09 +08:00
|
|
|
|
2019-05-22 22:44:17 +08:00
|
|
|
setPublishedPoll(meetingId, false);
|
|
|
|
|
2020-09-21 20:07:36 +08:00
|
|
|
return addPoll(meetingId, userId, poll, pollType, question);
|
2016-10-21 21:21:09 +08:00
|
|
|
}
|