More work with subscriptions
This commit is contained in:
parent
316e14f0ea
commit
918103a17b
12 changed files with 29 additions and 14 deletions
|
|
@ -1,6 +1,8 @@
|
|||
/* eslint-disable prefer-arrow-callback */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import { check } from 'meteor/check';
|
||||
import Perlin from 'loms.perlin';
|
||||
import Subscriptions from '../Subscriptions';
|
||||
|
||||
|
|
@ -42,5 +44,7 @@ Meteor.publish('subscriptions', function subscriptions() {
|
|||
// Note: subscriptions.view is also used when editing an existing subscription.
|
||||
Meteor.publish('subscriptions.view', function subscriptionsView(subscriptionId) {
|
||||
check(subscriptionId, String);
|
||||
return Subscriptions.find({ _id: subscriptionId, owner: this.userId });
|
||||
const id = new Mongo.ObjectID(subscriptionId);
|
||||
check(id, Meteor.Collection.ObjectID);
|
||||
return Subscriptions.find({ _id: id, owner: this.userId });
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue