Want to acces object in requests array of profile in users collection

i want to create a event in which by clicking on accept in the
termplate i want to get that respective object of requests array in
profile of users collection

this profile section of my users collection (accounts-password)

{"profile" : { "name" : { "first_name" : "Vibhor", "last_name" : "Yadav" }, "college_name" : "ssit", "gender" : "MALE", "friends" : [ ], "requests" : [ { "id" : "z6rDkvayDA5Ckoeab", "name" : "Nitin Gupta" } ], "requested" : [ { "id" : "M6edD427rG9WwhfNh", "name" : "suraj Kumar" } ]}

template to print requests

<template name = "notification">
  <div id="req-main-div">

        {{# each username in reqList}}
          <div id="req-user-name" value={{username.name}}>{{username.name}}</div>
          <div id="accept">accept</div>
          <div id="delete">delete</div>

helper to the template

reqList:function () {
var User = Meteor.user();
return User.profile.requests;

the method i tried

  'click #accept':function(){

iam not able to access DOM too

      throw new Meteor.Error('not-authorized','you are not signed in');
    var user = Meteor.user();

iam getting this on console

undefined//for DOM of # accept
Object// for accept in accept_request method
main: ()
__proto__: Object

Hi, have ya met TedSocialize?

You may find many of the packages in the Socialize set useful, but specifically the Friendships package is going to apply to this question.

1 Like

thanks a lot sir …