made ids optional in users publication
This commit is contained in:
@@ -35,7 +35,8 @@ Meteor.publish('user', function(){
|
|||||||
|
|
||||||
let userIdsSchema = new SimpleSchema({
|
let userIdsSchema = new SimpleSchema({
|
||||||
ids: {
|
ids: {
|
||||||
type: Array
|
type: Array,
|
||||||
|
optional: true,
|
||||||
},
|
},
|
||||||
'ids.$':{
|
'ids.$':{
|
||||||
type: String,
|
type: String,
|
||||||
@@ -45,7 +46,7 @@ let userIdsSchema = new SimpleSchema({
|
|||||||
|
|
||||||
Meteor.publish('userPublicProfiles', function(ids){
|
Meteor.publish('userPublicProfiles', function(ids){
|
||||||
userIdsSchema.validate({ids});
|
userIdsSchema.validate({ids});
|
||||||
if (!this.userId) return this.ready();
|
if (!this.userId || !ids) return this.ready();
|
||||||
return Meteor.users.find({
|
return Meteor.users.find({
|
||||||
_id: {$in: ids}
|
_id: {$in: ids}
|
||||||
},{
|
},{
|
||||||
|
|||||||
Reference in New Issue
Block a user