App.JoinRequestsController = Ember.ArrayController.extend
  join_requests: (-> @get('controllers.application.list.join_requests') ).property('controllers.application.list.join_requests')
  actions:
    rejectRequest: (join_request)->
      Ember.$.post('/user/reject_join_request', user_id: join_request.get('user.id')).then (response)->
        join_request.eraseRecord()
    approveRequest: (join_request)->
      Ember.$.post('/user/approve_join_request', user_id: join_request.get('user.id')).then (response)->
        join_request.eraseRecord()
