import ModalBase from 'ember-cli-dunlop/mixins/modal-base'
export default ModalBase.extend
  selected_users: []
  possible_users: []
  willOpenModal: ->
    @set 'possible_users', @store.peekAll('user')
    @get('model.users').then (users)=>
      @set 'selected_users', users.toArray()

  actions:
    saveRecord: ->
      @set('model.users', @get('selected_users'))
      @_super()
