MT#63605 fix GET invoicetemplates without reseller_id

* 'reseller' level invoice templates are correctly
  returned with reseller_id: null, instead of 500 error

Change-Id: Ied1e7626fcbb2c28bf3850dd1788f06574ef892b
(cherry picked from commit 0d3aac99a7)
(cherry picked from commit ed71b62616)
mr12.5.1
Kirill Solomko 4 months ago
parent 4effa0d228
commit d091322d46

@ -46,7 +46,9 @@ sub hal_from_item {
Data::HAL::Link->new(relation => 'collection', href => sprintf("/api/%s/", $self->resource_name)),
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:resellers', href => sprintf("/api/resellers/%d", $item->reseller_id)),
$item->reseller_id
? Data::HAL::Link->new(relation => 'ngcp:resellers', href => sprintf("/api/resellers/%d", $item->reseller_id))
: (),
],
relation => 'ngcp:'.$self->resource_name,
);

Loading…
Cancel
Save