|
|
|
@ -3129,13 +3129,15 @@ define(function(require){ |
|
|
|
resource: 'callflow.list', |
|
|
|
data: { |
|
|
|
accountId: self.accountId, |
|
|
|
filters: { 'has_key':'owner_id' } |
|
|
|
filters: { |
|
|
|
has_key:'owner_id', |
|
|
|
filter_type: 'mainUserCallflow', |
|
|
|
paginate: 'false' |
|
|
|
} |
|
|
|
}, |
|
|
|
success: function(data, status) { |
|
|
|
var userCallflows = _.filter(data.data, function(callflow) { |
|
|
|
return (callflow.type === 'mainUserCallflow' || !('type' in callflow)); |
|
|
|
}); |
|
|
|
_callback(null, userCallflows); |
|
|
|
var mapCallflowsByOwnerId = _.indexBy(data.data, 'owner_id'); |
|
|
|
_callback(null, mapCallflowsByOwnerId); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
@ -3230,11 +3232,11 @@ define(function(require){ |
|
|
|
}); |
|
|
|
|
|
|
|
_.each(results.users, function(user) { |
|
|
|
var userCallflow = _.find(results.userCallflows, function(callflow) { return callflow.owner_id === user.id }); |
|
|
|
if(userCallflow) { |
|
|
|
user.id = userCallflow.id; |
|
|
|
if(results.userCallflows.hasOwnProperty(user.id)) { |
|
|
|
user.id = results.userCallflows[user.id].id; |
|
|
|
user.module = 'callflow'; |
|
|
|
} else { |
|
|
|
} |
|
|
|
else { |
|
|
|
user.module = 'user'; |
|
|
|
} |
|
|
|
callEntities.userCallflows.push(user); |
|
|
|
|