From 64e0428b859e593749cc4ce317f1b7c6fbb74fd9 Mon Sep 17 00:00:00 2001 From: Irina Peshinskaya Date: Tue, 21 Oct 2014 13:13:11 +0300 Subject: [PATCH] MT#9671 Add search of subscribers by customer external_id too. Again. This reverts commit c52040353fbcddc5211e0465e3791428c74a0922. Tests failed also with this revert, so it seems as safe to return this functionality. --- lib/NGCP/Panel/Controller/API/Subscribers.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/NGCP/Panel/Controller/API/Subscribers.pm b/lib/NGCP/Panel/Controller/API/Subscribers.pm index ce117d727d..f10784cdb5 100644 --- a/lib/NGCP/Panel/Controller/API/Subscribers.pm +++ b/lib/NGCP/Panel/Controller/API/Subscribers.pm @@ -83,6 +83,19 @@ class_has 'query_params' => ( }, }, }, + { + param => 'customer_external_id', + description => 'Filter for subscribers of a specific customer external_id.', + query => { + first => sub { + my $q = shift; + return { 'contract.external_id' => { like => $q } }; + }, + second => sub { + return { join => 'contract' }; + }, + }, + }, { param => 'is_pbx_group', description => 'Filter for subscribers who are (not) pbx_groups.',