diff --git a/Koha/REST/V1/Hold.pm b/Koha/REST/V1/Holds.pm similarity index 95% rename from Koha/REST/V1/Hold.pm rename to Koha/REST/V1/Holds.pm index cdc7aa12d8..a899e43a5e 100644 --- a/Koha/REST/V1/Hold.pm +++ b/Koha/REST/V1/Holds.pm @@ -1,4 +1,4 @@ -package Koha::REST::V1::Hold; +package Koha::REST::V1::Holds; # This file is part of Koha. # @@ -181,10 +181,10 @@ sub add { if ( $_->isa('Koha::Exceptions::Object::FKConstraint') ) { my $broken_fk = $_->broken_fk; - if ( grep { $_ eq $broken_fk } keys %{$Koha::REST::V1::Hold::to_api_mapping} ) { + if ( grep { $_ eq $broken_fk } keys %{$Koha::REST::V1::Holds::to_api_mapping} ) { $c->render( status => 404, - openapi => $Koha::REST::V1::Hold::to_api_mapping->{$broken_fk} . ' not found.' + openapi => $Koha::REST::V1::Holds::to_api_mapping->{$broken_fk} . ' not found.' ); } else { @@ -284,8 +284,8 @@ sub _to_api { my $hold = shift; # Rename attributes - foreach my $column ( keys %{ $Koha::REST::V1::Hold::to_api_mapping } ) { - my $mapped_column = $Koha::REST::V1::Hold::to_api_mapping->{$column}; + foreach my $column ( keys %{ $Koha::REST::V1::Holds::to_api_mapping } ) { + my $mapped_column = $Koha::REST::V1::Holds::to_api_mapping->{$column}; if ( exists $hold->{ $column } && defined $mapped_column ) { @@ -313,8 +313,8 @@ attribute names. sub _to_model { my $hold = shift; - foreach my $attribute ( keys %{ $Koha::REST::V1::Hold::to_model_mapping } ) { - my $mapped_attribute = $Koha::REST::V1::Hold::to_model_mapping->{$attribute}; + foreach my $attribute ( keys %{ $Koha::REST::V1::Holds::to_model_mapping } ) { + my $mapped_attribute = $Koha::REST::V1::Holds::to_model_mapping->{$attribute}; if ( exists $hold->{ $attribute } && defined $mapped_attribute ) { diff --git a/api/v1/swagger/paths/holds.json b/api/v1/swagger/paths/holds.json index c4139106e5..afeaac44d1 100644 --- a/api/v1/swagger/paths/holds.json +++ b/api/v1/swagger/paths/holds.json @@ -1,7 +1,7 @@ { "/holds": { "get": { - "x-mojo-to": "Hold#list", + "x-mojo-to": "Holds#list", "operationId": "listHolds", "tags": ["patrons", "holds"], "parameters": [ @@ -150,7 +150,7 @@ } }, "post": { - "x-mojo-to": "Hold#add", + "x-mojo-to": "Holds#add", "operationId": "addHold", "tags": ["patrons", "holds"], "parameters": [{ @@ -250,7 +250,7 @@ }, "/holds/{hold_id}": { "put": { - "x-mojo-to": "Hold#edit", + "x-mojo-to": "Holds#edit", "operationId": "editHold", "tags": ["holds"], "parameters": [{ @@ -334,7 +334,7 @@ } }, "delete": { - "x-mojo-to": "Hold#delete", + "x-mojo-to": "Holds#delete", "operationId": "deleteHold", "tags": ["holds"], "parameters": [{