–Solved but kinda messy – Solution at 3rd comment–
I am trying to get users’ profile pictures, storing in user document like user.profile.pp.
Meteor.method:
getUserPpByUsername: function(username){
return Meteor.users.findOne({username: username}).profile.pp;
// It returns exactly what i want
}
The method returns value what i want, like: ‘http://pbs.twimg.imageimageimage’
In my template helper i tried Meteor.apply:
getPpByAuthor: function(author){
return Meteor.apply('getUserPpByUsername', [author], true, {returnStubValue: true});
// undefined
}
Befor this i tried Meteor.call:
getPpByAuthor: function(author) {
return Meteor.call('getUserPpByUsername', author, function(error, result){
return result;
});
}
Also i console.logged this return values, returned undefineds.
By the way, when i tried just
return Meteor.users.findOne({username: author}).profile.pp;
It returned just the currentUser’s pp value.
What i am missing?
Edit: I was using Session.set(‘returnThis’, result), and i was returning this with Session.get…
But now, i cant do this with Session.
Hope, i can explain my problem, sorry for bad english.