From d40126ef0a34acc5863ef76b6877b4eeffac1d69 Mon Sep 17 00:00:00 2001 From: Marco Capetta Date: Fri, 13 Sep 2024 17:12:32 +0200 Subject: [PATCH] MT#60756 Fix subscriberprofiles POST api call as reseller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Administrators with reseller role were not able to create new subscriberprofiles because API was fialing with 500 error. In particular: LOG="«DBIx::Class::Row::store_column(): No such column 'reseller_id' on NGCP::Panel::Model::DB::voip_subscriber_profiles at /usr/share/perl5/NGCP/Panel/Controller/API/SubscriberProfiles.pm line 172» The error was caused by the addition of the reseller_id info in the $resourse even if not needed. Change-Id: I7970a2716d7af959639937a9a844160ab73a9176 --- lib/NGCP/Panel/Controller/API/SubscriberProfiles.pm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/NGCP/Panel/Controller/API/SubscriberProfiles.pm b/lib/NGCP/Panel/Controller/API/SubscriberProfiles.pm index ee71a92532..f8e8885f10 100644 --- a/lib/NGCP/Panel/Controller/API/SubscriberProfiles.pm +++ b/lib/NGCP/Panel/Controller/API/SubscriberProfiles.pm @@ -134,10 +134,7 @@ sub POST :Allow { resource => $resource, form => $form, ); - if($c->user->roles eq "admin") { - } elsif($c->user->roles eq "reseller") { - $resource->{reseller_id} = $c->user->reseller_id; - } + $resource->{set_id} = delete $resource->{profile_set_id}; my $set = $c->model('DB')->resultset('voip_subscriber_profile_sets');