Bugzilla – Attachment 85860 Details for
Bug 20006
Adapt /v1/holds to new naming guidelines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20006: (follow-up) Plural class name
Bug-20006-follow-up-Plural-class-name.patch (text/plain), 3.58 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-02-28 12:48:43 UTC
(
hide
)
Description:
Bug 20006: (follow-up) Plural class name
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-02-28 12:48:43 UTC
Size:
3.58 KB
patch
obsolete
>From c9860086f2a9be7175bc4c681a48a83079e47fc6 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 24 Jan 2019 16:13:25 -0300 >Subject: [PATCH] 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> >--- > Koha/REST/V1/{Hold.pm => Holds.pm} | 14 +++++++------- > api/v1/swagger/paths/holds.json | 8 ++++---- > 2 files changed, 11 insertions(+), 11 deletions(-) > rename Koha/REST/V1/{Hold.pm => Holds.pm} (95%) > >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": [{ >-- >2.21.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20006
:
84374
|
84375
|
84376
|
84381
|
84382
|
84386
|
84395
|
84396
|
84397
|
84398
|
84399
|
85051
|
85052
|
85053
|
85054
|
85055
|
85856
|
85857
|
85858
|
85859
| 85860