|
|
|
|
@ -128,6 +128,19 @@ sub query_params {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
param => 'subscriber_external_id',
|
|
|
|
|
description => 'Filter for subscribers by subscriber\'s external_id.',
|
|
|
|
|
query => {
|
|
|
|
|
first => sub {
|
|
|
|
|
my $q = shift;
|
|
|
|
|
return { 'me.external_id' => { like => $q } };
|
|
|
|
|
},
|
|
|
|
|
second => sub {
|
|
|
|
|
return { };
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
param => 'is_pbx_group',
|
|
|
|
|
description => 'Filter for subscribers who are (not) pbx_groups.',
|
|
|
|
|
@ -305,7 +318,7 @@ sub GET :Allow {
|
|
|
|
|
$hal->resource({
|
|
|
|
|
total_count => $total_count,
|
|
|
|
|
});
|
|
|
|
|
my $response = HTTP::Response->new(HTTP_OK, undef,
|
|
|
|
|
my $response = HTTP::Response->new(HTTP_OK, undef,
|
|
|
|
|
HTTP::Headers->new($hal->http_headers(skip_links => 1)), $hal->as_json);
|
|
|
|
|
$c->response->headers($response->headers);
|
|
|
|
|
$c->response->body($response->content);
|
|
|
|
|
@ -341,7 +354,7 @@ sub POST :Allow {
|
|
|
|
|
my $guard = $schema->txn_scope_guard;
|
|
|
|
|
{
|
|
|
|
|
my $resource = $self->get_valid_post_data(
|
|
|
|
|
c => $c,
|
|
|
|
|
c => $c,
|
|
|
|
|
media_type => 'application/json',
|
|
|
|
|
);
|
|
|
|
|
last unless $resource;
|
|
|
|
|
@ -405,7 +418,7 @@ sub POST :Allow {
|
|
|
|
|
$self->error($c, HTTP_INTERNAL_SERVER_ERROR, "Failed to create subscriber.");
|
|
|
|
|
last;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
last unless $self->add_create_journal_item_hal($c,sub {
|
|
|
|
|
my $self = shift;
|
|
|
|
|
my ($c) = @_;
|
|
|
|
|
|