Skip to content

Commit

Permalink
can we move it to something like kz_account:children/1 ?
Browse files Browse the repository at this point in the history
  • Loading branch information
onnet committed Feb 21, 2016
1 parent 66d5bd5 commit d159381
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion applications/crossbar/src/modules/cb_notifications.erl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
-define(CUSTOMER_UPDATE, <<"customer_update">>).
-define(MESSAGE, <<"message">>).
-define(CB_LIST_SMTP_LOG, <<"notifications/smtp_log">>).
-define(ACC_CHILDREN_LIST, <<"accounts/listing_by_children">>).

-define(MACROS, <<"macros">>).

Expand Down Expand Up @@ -279,7 +280,7 @@ validate_recipient_id(RecipientId, Context) ->
ViewOpts = [{'startkey', [SenderId]}
,{'endkey', [SenderId, wh_json:new()]}
],
case couch_mgr:get_results(?WH_ACCOUNTS_DB, <<"accounts/listing_by_children">>, ViewOpts) of
case couch_mgr:get_results(?WH_ACCOUNTS_DB, ?ACC_CHILDREN_LIST, ViewOpts) of
{'ok', Accounts} ->
AccountIds = lists:map(fun(Account) -> wh_json:get_value(<<"id">>, Account) end, Accounts),
case lists:member(RecipientId, AccountIds) of
Expand Down

0 comments on commit d159381

Please sign in to comment.