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({
ids: {
type: Array
type: Array,
optional: true,
},
'ids.$':{
type: String,
@@ -45,7 +46,7 @@ let userIdsSchema = new SimpleSchema({
Meteor.publish('userPublicProfiles', function(ids){
userIdsSchema.validate({ids});
if (!this.userId) return this.ready();
if (!this.userId || !ids) return this.ready();
return Meteor.users.find({
_id: {$in: ids}
},{