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';
|
|
|
|
|
2023-03-07 21:47:43 +08:00
|
|
|
export default async function pollStopped({ body }, meetingId) {
|
2017-10-12 08:33:57 +08:00
|
|
|
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);
|
|
|
|
|
2023-03-07 21:47:43 +08:00
|
|
|
const result = await removePoll(meetingId, pollId);
|
|
|
|
|
|
|
|
return result;
|
2016-10-22 01:11:28 +08:00
|
|
|
}
|
2016-10-22 02:56:42 +08:00
|
|
|
|
2023-03-07 21:47:43 +08:00
|
|
|
const result = await clearPolls(meetingId);
|
|
|
|
|
|
|
|
return result;
|
2016-10-21 21:21:09 +08:00
|
|
|
}
|