App.JoinRequestsController = Ember.Controller.extend
  join_requests: Ember.computed.alias 'globals.active_list.join_requests'
  actions:
    rejectRequest: (join_request)->
      Ember.$.post("#{$data_host}/user/reject_join_request", user_id: join_request.get('user.id')).then (response)->
        join_request.eraseRecord()
    approveRequest: (join_request)->
      Ember.$.post("#{$data_host}/user/approve_join_request", user_id: join_request.get('user.id')).then (response)->
        join_request.eraseRecord()
