2016-10-21 21:21:09 +08:00
|
|
|
import { check } from 'meteor/check';
|
2016-10-22 01:11:28 +08:00
|
|
|
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);
|
|
|
|
|
2016-10-22 01:11:28 +08:00
|
|
|
if (poll) {
|
2017-10-12 08:33:57 +08:00
|
|
|
const { pollId } = poll;
|
2016-10-22 01:11:28 +08:00
|
|
|
|
|
|
|
check(pollId, String);
|
|
|
|
|
2016-10-22 01:42:43 +08:00
|
|
|
return removePoll(meetingId, pollId);
|
2016-10-22 01:11:28 +08:00
|
|
|
}
|
2016-10-22 02:56:42 +08:00
|
|
|
|
|
|
|
return clearPolls(meetingId);
|
2016-10-21 21:21:09 +08:00
|
|
|
}
|