+_                       = require 'lodash'
 kd                      = require 'kd'
 actionTypes             = require './actiontypes'
 showErrorNotification   = require 'app/util/showErrorNotification'


    [channel] = channels
    dispatch CREATE_PRIVATE_CHANNEL_SUCCESS, { channel }


module.exports = {


  dispatch CREATE_PRIVATE_CHANNEL, options

  _options = _mapPrivateChannelOptions options

  kd.singletons.socialapi.channel.createChannelWithParticipants _options, (err, channels) ->
    if err
      dispatch CREATE_PRIVATE_CHANNEL_FAIL, { err }
      showErrorNotification err, userMessage: err.message
