MT#60756 Fix subscriberprofiles POST api call as reseller

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
(cherry picked from commit d40126ef0a)
(cherry picked from commit 5d270020e0)
mr10.5.7
Marco Capetta 8 months ago
parent 30ff93f660
commit 1360036bbd

@ -132,10 +132,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');

Loading…
Cancel
Save