made ids optional in users publication

This commit is contained in:
Thaum Rystra
2020-05-21 16:52:36 +02:00
parent 81131ddb9f
commit afa641a290

View File

@@ -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}
},{ },{