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:
parent
f6b3d9979d
commit
41f394f4ee
2 changed files with 11 additions and 11 deletions
|
@ -1,4 +1,4 @@
|
||||||
package Koha::REST::V1::Hold;
|
package Koha::REST::V1::Holds;
|
||||||
|
|
||||||
# This file is part of Koha.
|
# This file is part of Koha.
|
||||||
#
|
#
|
||||||
|
@ -181,10 +181,10 @@ sub add {
|
||||||
if ( $_->isa('Koha::Exceptions::Object::FKConstraint') ) {
|
if ( $_->isa('Koha::Exceptions::Object::FKConstraint') ) {
|
||||||
my $broken_fk = $_->broken_fk;
|
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(
|
$c->render(
|
||||||
status => 404,
|
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 {
|
else {
|
||||||
|
@ -284,8 +284,8 @@ sub _to_api {
|
||||||
my $hold = shift;
|
my $hold = shift;
|
||||||
|
|
||||||
# Rename attributes
|
# Rename attributes
|
||||||
foreach my $column ( keys %{ $Koha::REST::V1::Hold::to_api_mapping } ) {
|
foreach my $column ( keys %{ $Koha::REST::V1::Holds::to_api_mapping } ) {
|
||||||
my $mapped_column = $Koha::REST::V1::Hold::to_api_mapping->{$column};
|
my $mapped_column = $Koha::REST::V1::Holds::to_api_mapping->{$column};
|
||||||
if ( exists $hold->{ $column }
|
if ( exists $hold->{ $column }
|
||||||
&& defined $mapped_column )
|
&& defined $mapped_column )
|
||||||
{
|
{
|
||||||
|
@ -313,8 +313,8 @@ attribute names.
|
||||||
sub _to_model {
|
sub _to_model {
|
||||||
my $hold = shift;
|
my $hold = shift;
|
||||||
|
|
||||||
foreach my $attribute ( keys %{ $Koha::REST::V1::Hold::to_model_mapping } ) {
|
foreach my $attribute ( keys %{ $Koha::REST::V1::Holds::to_model_mapping } ) {
|
||||||
my $mapped_attribute = $Koha::REST::V1::Hold::to_model_mapping->{$attribute};
|
my $mapped_attribute = $Koha::REST::V1::Holds::to_model_mapping->{$attribute};
|
||||||
if ( exists $hold->{ $attribute }
|
if ( exists $hold->{ $attribute }
|
||||||
&& defined $mapped_attribute )
|
&& defined $mapped_attribute )
|
||||||
{
|
{
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"/holds": {
|
"/holds": {
|
||||||
"get": {
|
"get": {
|
||||||
"x-mojo-to": "Hold#list",
|
"x-mojo-to": "Holds#list",
|
||||||
"operationId": "listHolds",
|
"operationId": "listHolds",
|
||||||
"tags": ["patrons", "holds"],
|
"tags": ["patrons", "holds"],
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
@ -150,7 +150,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"post": {
|
"post": {
|
||||||
"x-mojo-to": "Hold#add",
|
"x-mojo-to": "Holds#add",
|
||||||
"operationId": "addHold",
|
"operationId": "addHold",
|
||||||
"tags": ["patrons", "holds"],
|
"tags": ["patrons", "holds"],
|
||||||
"parameters": [{
|
"parameters": [{
|
||||||
|
@ -250,7 +250,7 @@
|
||||||
},
|
},
|
||||||
"/holds/{hold_id}": {
|
"/holds/{hold_id}": {
|
||||||
"put": {
|
"put": {
|
||||||
"x-mojo-to": "Hold#edit",
|
"x-mojo-to": "Holds#edit",
|
||||||
"operationId": "editHold",
|
"operationId": "editHold",
|
||||||
"tags": ["holds"],
|
"tags": ["holds"],
|
||||||
"parameters": [{
|
"parameters": [{
|
||||||
|
@ -334,7 +334,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
"x-mojo-to": "Hold#delete",
|
"x-mojo-to": "Holds#delete",
|
||||||
"operationId": "deleteHold",
|
"operationId": "deleteHold",
|
||||||
"tags": ["holds"],
|
"tags": ["holds"],
|
||||||
"parameters": [{
|
"parameters": [{
|
||||||
|
|
Loading…
Reference in a new issue