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

23 lines
443 B
JavaScript
Raw Normal View History

2016-10-21 21:21:09 +08:00
import { check } from 'meteor/check';
2016-10-22 01:42:43 +08:00
import updateVotes from '../modifiers/updateVotes';
2016-10-21 21:21:09 +08:00
2017-10-12 08:33:57 +08:00
export default function userVoted({ body }, meetingId) {
const { poll } = body;
2016-10-21 21:21:09 +08:00
check(meetingId, String);
check(poll, {
id: String,
answers: [
{
id: Number,
key: String,
numVotes: Number,
},
],
numRespondents: Number,
numResponders: Number,
});
2016-10-21 21:21:09 +08:00
return updateVotes(poll, meetingId);
2017-06-03 03:25:02 +08:00
}