Hey so I’ve been trying out the socialize:friendship package for adding friends and I’m having a lot of problems. I am managing to send a friend request quite nicely with this method:
sendFriendRequest(email){
var user = Accounts.findUserByEmail(email);
if (user !== null){
user.requestFriendship();
} else {
}
}
but when I’m trying to show the requests in this code, nothing happens:
allRequests() {
var currentUser = Meteor.user();
var requests = currentUser.requests();
return requests;
}
render(){
var data =
this.allRequests().forEach(function(request){
alert("test");
//return <EventSingle key={event._id} event={event}/>
return (<div className="request">
<p>{request.requesterId} would like to be friends</p>
<p>
<a href="#" >Accept</a>
<a href="#" >Deny</a>
<a href="#" >Ignore</a>
</p>
</div>)
});
I’ve tried alot of different things but can’t figure out how to do this so please help.