Bug 20006: (follow-up) Plural class name

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Tomás Cohen Arazi 2019-01-24 16:13:25 -03:00 committed by Nick Clemens
parent f6b3d9979d
commit 41f394f4ee
2 changed files with 11 additions and 11 deletions

View file

@ -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 )
{

View file

@ -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": [{