b574859ab2
* upstream/master: Improve lint script Update package-lock with the new packages Add missing packages and fix formating Switched from 2 deprecated packages Corrected findDOMNode import for the poll shape Switched from the deprecated react-addons-css-transition-group package to a recommended one Updated react-meteor-data to remove a new React 15 warning Updated main packages Switched to prop-types package to remove new React 15 warnings Improve ESLint rules Linter auto fix Change lint import configs to our pattern Remove autofix script Replace JSCS in favor of ESLint
28 lines
704 B
JavaScript
28 lines
704 B
JavaScript
import { Meteor } from 'meteor/meteor';
|
|
import Polls from '/imports/api/polls';
|
|
import { check } from 'meteor/check';
|
|
import { logger } from '/imports/startup/server/logger';
|
|
import mapToAcl from '/imports/startup/mapToAcl';
|
|
|
|
Meteor.publish('polls', function () {
|
|
const boundPolls = polls.bind(this);
|
|
return mapToAcl('subscriptions.polls', boundPolls)(arguments);
|
|
});
|
|
|
|
function polls(credentials) {
|
|
const { meetingId, requesterUserId, requesterToken } = credentials;
|
|
|
|
check(meetingId, String);
|
|
check(requesterUserId, String);
|
|
check(requesterToken, String);
|
|
|
|
const selector = {
|
|
meetingId,
|
|
users: requesterUserId,
|
|
};
|
|
|
|
let options = {};
|
|
|
|
return Polls.find(selector, options);
|
|
};
|