From 2bc33470b050e89cb65a8f4c1c54a0e2d8faa2ee Mon Sep 17 00:00:00 2001 From: Rene Krenn Date: Fri, 8 Jan 2021 17:17:17 +0100 Subject: [PATCH] TT#107051 enable "add" for PATCH /billingprofiles/x (cherry picked from commit 92455d85664966e6470788c5c34167d71377b74a) (cherry picked from commit b46ad2f1fec97416527673efa04066681a7d2014) Change-Id: I4a284fb0ea636402c19e98369dbb9c2a05ea1d94 --- lib/NGCP/Panel/Controller/API/BillingProfilesItem.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/NGCP/Panel/Controller/API/BillingProfilesItem.pm b/lib/NGCP/Panel/Controller/API/BillingProfilesItem.pm index 41576dd7be..41ffe874d4 100644 --- a/lib/NGCP/Panel/Controller/API/BillingProfilesItem.pm +++ b/lib/NGCP/Panel/Controller/API/BillingProfilesItem.pm @@ -78,6 +78,7 @@ sub PATCH :Allow { c => $c, id => $id, media_type => 'application/json-patch+json', + ops => ["add", "replace", "copy", "remove"], ); last unless $json; @@ -85,8 +86,7 @@ sub PATCH :Allow { my $profile = $self->profile_by_id($c, $id); last unless $self->resource_exists($c, billingprofile => $profile); my $old_resource = $self->resource_from_item($c, $profile, $form); - $old_resource = clone($old_resource); - my $resource = $self->apply_patch($c, $old_resource, $json); + my $resource = $self->apply_patch($c, clone($old_resource), $json); last unless $resource; $profile = $self->update_profile($c, $profile, $old_resource, $resource, $form);