From 96364f14a5eb93a8d4fe041fa6a43c033d3d2bc2 Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Tue, 9 Apr 2024 13:26:10 +0200 Subject: [PATCH] MT#59835 /api/billingzones fix HAL ngcp:billingfees relation * billing fees relation was rendering all associated billing fees and that was causing huge data sets to be returned if a billing zones had many fees, now instead a single link is returned /api/billingfees/?billing_zone_id=:id. this is also on par with other links like /api/billingfees/:id Change-Id: Iabb7afb3bf43abf9a22c71750d45a1962a7f16ec (cherry picked from commit e4cda08bd4c09f6f17503e24640ce9f76b8aa7bf) --- lib/NGCP/Panel/Role/API/BillingZones.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/NGCP/Panel/Role/API/BillingZones.pm b/lib/NGCP/Panel/Role/API/BillingZones.pm index 8df19ec377..7f453952e2 100644 --- a/lib/NGCP/Panel/Role/API/BillingZones.pm +++ b/lib/NGCP/Panel/Role/API/BillingZones.pm @@ -56,7 +56,7 @@ sub hal_from_zone { 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, $zone->id)), Data::HAL::Link->new(relation => 'ngcp:billingprofiles', href => sprintf("/api/billingprofiles/%d", $zone->billing_profile->id)), - ( map { Data::HAL::Link->new(relation => 'ngcp:billingfees', href => sprintf("/api/billingfees/%d", $_->id)) } $zone->billing_fees->all ), + Data::HAL::Link->new(relation => 'ngcp:billingfees', href => sprintf("/api/billingfees/?billing_zone_id=%d", $zone->id)), $self->get_journal_relation_link($c, $zone->id), ], relation => 'ngcp:'.$self->resource_name,