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';
|
|
|
|
|
|
|
|
export default function pollStopped({ payload }) {
|
|
|
|
check(payload, Object);
|
|
|
|
|
|
|
|
const meetingId = payload.meeting_id;
|
2016-10-22 01:11:28 +08:00
|
|
|
const poll = payload.poll;
|
2016-10-21 21:21:09 +08:00
|
|
|
|
|
|
|
check(meetingId, String);
|
|
|
|
|
2016-10-22 01:11:28 +08:00
|
|
|
if (poll) {
|
|
|
|
const pollId = poll.id;
|
|
|
|
|
|
|
|
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
|
|
|
}
|