From a2b4c627f382b0026f2079c3145e9df7feeff735 Mon Sep 17 00:00:00 2001 From: Irina Peshinskaya Date: Mon, 20 Oct 2014 16:57:50 +0300 Subject: [PATCH] MT#9671 Add search of subscribers by customer external_id too. --- 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.',