MT#59806 add missing cfdestinationsets HAL link type

* add missing:
   "_links" : {
      "ngcp:cftimesets" : [
        ....
      ],
  in the collection representation

Change-Id: I59fade61ae2679833c43fd5501d14ca45a376572
mr12.4
Kirill Solomko 1 year ago
parent b2a1bc00d1
commit c006e9efc1

@ -28,6 +28,8 @@ sub get_form {
sub hal_from_item {
my ($self, $c, $item, $form, $params) = @_;
my $type = 'cfdestinationsets';
my %resource = $item->get_inflated_columns;
my @destinations;
for my $dest ($item->voip_cf_destinations->all) {
@ -60,6 +62,7 @@ sub hal_from_item {
Data::HAL::Link->new(relation => 'collection', href => sprintf("%s", $self->dispatch_path)),
Data::HAL::Link->new(relation => 'profile', href => 'http://purl.org/sipwise/ngcp-api/'),
Data::HAL::Link->new(relation => 'self', href => sprintf("%s%d", $self->dispatch_path, $item->id)),
Data::HAL::Link->new(relation => "ngcp:$type", href => sprintf("/api/%s/%d", $type, $item->id)),
Data::HAL::Link->new(relation => "ngcp:subscribers", href => sprintf("/api/subscribers/%d", $b_subs_id)),
$self->get_journal_relation_link($c, $item->id),
],

Loading…
Cancel
Save