@ -24,6 +24,7 @@ sub get_form {
sub hal_from_item {
my ( $ self , $ c , $ item , $ type ) = @ _ ;
$ type // = $ self - > container_resource_type ;
my $ print_type = $ type ;
$ print_type = "customers" if $ print_type eq "contracts" ;
my $ hal = Data::HAL - > new (
@ -60,6 +61,8 @@ sub _check_profile {
sub get_resource {
my ( $ self , $ c , $ item , $ type ) = @ _ ;
$ type // = $ self - > container_resource_type ;
my $ prefs ;
my % profile_attrs = ( ) ; # for filtering profiles based list
my % profile_allowed_attrs ; # for filtering subscriber attrs on its profile
@ -273,6 +276,7 @@ sub get_resource {
sub _item_rs {
my ( $ self , $ c , $ type ) = @ _ ;
my $ item_rs ;
$ type // = $ self - > container_resource_type ;
if ( $ type eq "domains" ) {
# we actually return the domain rs here, as we can easily
@ -380,6 +384,7 @@ sub _item_rs {
sub item_by_id {
my ( $ self , $ c , $ id , $ type ) = @ _ ;
$ type // = $ self - > container_resource_type ;
my $ item_rs = $ self - > item_rs ( $ c , $ type ) ;
return $ item_rs - > find ( $ id ) ;
}
@ -439,6 +444,12 @@ sub get_preference_rs {
sub update_item {
my ( $ self , $ c , $ item , $ old_resource , $ resource , $ replace , $ type ) = @ _ ;
if ( ref $ replace || ! defined $ replace ) {
$ replace = uc ( $ c - > request - > method ) eq 'PUT' ;
}
if ( ref $ type || ! defined $ type ) {
$ type = $ self - > container_resource_type ;
}
delete $ resource - > { id } ;
my $ accessor ;
my $ elem ;