Skip to content

Commit

Permalink
KAZOO-6079: update callflow crossbar listing to include modules in th…
Browse files Browse the repository at this point in the history
…e flow (2600hz#5674)
  • Loading branch information
k-anderson authored and jamesaimonetti committed Apr 9, 2019
1 parent ca32d37 commit 804e6ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/kazoo_apps/priv/couchdb/account/callflows.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"language": "javascript",
"views": {
"crossbar_listing": {
"map": "function(doc) { if (doc.pvt_type != 'callflow' || doc.pvt_deleted) return; var featurecode = (!doc.featurecode) ? false : doc.featurecode; emit(doc._id, {'id': doc._id, 'name': doc.name, 'type': doc.type, 'numbers': doc.numbers, 'patterns': doc.patterns, 'featurecode': featurecode, 'owner_id': doc.owner_id, 'group_id': doc.group_id}); }"
"map": "function (doc) { if (doc.pvt_type != 'callflow' || doc.pvt_deleted) return; var featurecode = (!doc.featurecode) ? false : doc.featurecode; var modules = []; if (doc.flow) var walkTree = (function recursiveWalkTree(flow) { if (flow.module && (flow.data && flow.data.skip_module !== true)) modules.push(flow.module); if (flow.children) { var children = flow.children; for (var key in children) {if (!children.hasOwnProperty(key)) continue; recursiveWalkTree(children[key]);}}})(doc.flow); var onlyUnique = function(value, index, self) { return self.indexOf(value) === index; }; modules = modules.filter(onlyUnique); emit(doc._id, {'id': doc._id, 'name': doc.name, 'type': doc.type, 'numbers': doc.numbers, 'patterns': doc.patterns, 'featurecode': featurecode, 'owner_id': doc.owner_id, 'group_id': doc.group_id, 'modules': modules});}"
},
"listing_by_number": {
"map": "function(doc) { if (doc.pvt_type != 'callflow' || doc.pvt_deleted) return; for (var i in doc.numbers) emit(doc.numbers[i], {'name' : doc.name || doc._id} ); }"
Expand Down

0 comments on commit 804e6ce

Please sign in to comment.