TT#119200 Expose subscriber object on /api/autoattendants

* implement support for 'expand' param which,
	    when used with the api call, will modify
	    the response to contain the subscriber object

Change-Id: Id25dc0bb258bc777d698e043ea8ddc785e12f68a
mr9.5.1
Flaviu Mates 5 years ago
parent a9817e52d8
commit 232cf704c0

@ -50,6 +50,14 @@ sub hal_from_item {
run => 0,
);
if ($c->req->param('expand') && is_int($c->req->param('expand')) && $c->req->param('expand') == 1) {
my $subscriber_form = NGCP::Panel::Role::API::Subscribers->get_form($c);
$resource->{subscriber} = NGCP::Panel::Role::API::Subscribers->resource_from_item($c, $item, $subscriber_form);
#don't show passwords here
delete $resource->{subscriber}->{webpassword};
delete $resource->{subscriber}->{password};
}
$hal->resource($resource);
return $hal;
}

Loading…
Cancel
Save