Bugzilla – Attachment 168908 Details for
Bug 36641
Add an endpoint to list circulation rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36641: Harmonize parameter names
Bug-36641-Harmonize-parameter-names.patch (text/plain), 4.11 KB, created by
Martin Renvoize (ashimema)
on 2024-07-12 14:16:53 UTC
(
hide
)
Description:
Bug 36641: Harmonize parameter names
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-07-12 14:16:53 UTC
Size:
4.11 KB
patch
obsolete
>From 12fd3bcda9acc9709eeaad018a639e862752e37b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 2 Jul 2024 09:50:15 -0300 >Subject: [PATCH] Bug 36641: Harmonize parameter names > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/REST/V1/CirculationRules.pm | 6 +++--- > api/v1/swagger/paths/circulation_rules.yaml | 16 ++++++++-------- > t/db_dependent/api/v1/circulation_rules.t | 4 ++-- > 3 files changed, 13 insertions(+), 13 deletions(-) > >diff --git a/Koha/REST/V1/CirculationRules.pm b/Koha/REST/V1/CirculationRules.pm >index eb0322ee45c..0a112ff03c3 100644 >--- a/Koha/REST/V1/CirculationRules.pm >+++ b/Koha/REST/V1/CirculationRules.pm >@@ -49,9 +49,9 @@ List all effective rules for the requested patron/item/branch combination > sub list_effective_rules { > my $c = shift->openapi->valid_input or return; > >- my $item_type = $c->param('itemtype'); >- my $branchcode = $c->param('library'); >- my $patron_category = $c->param('category'); >+ my $item_type = $c->param('item_type_id'); >+ my $branchcode = $c->param('library_id'); >+ my $patron_category = $c->param('patron_category_id'); > my $rules = $c->param('rules') // [ keys %{ Koha::CirculationRules->rule_kinds } ]; > > if ($item_type) { >diff --git a/api/v1/swagger/paths/circulation_rules.yaml b/api/v1/swagger/paths/circulation_rules.yaml >index 981e61e32b6..178855d2107 100644 >--- a/api/v1/swagger/paths/circulation_rules.yaml >+++ b/api/v1/swagger/paths/circulation_rules.yaml >@@ -5,23 +5,23 @@ > operationId: listCirculationRules > tags: > - circulation_rules >- summary: Get circulation rules for this item/library/patron combination >+ summary: Get circulation rules for a given item type/library/patron combination. > produces: > - application/json > parameters: >- - name: item_type >+ - name: item_type_id > in: query >- description: The itemtype >+ description: The item type identifier > required: false > type: string >- - name: library >+ - name: library_id > in: query >- description: The library code >+ description: The library identifier > required: false > type: string >- - name: patron_category >+ - name: patron_category_id > in: query >- description: The patron category >+ description: The patron category identifier > required: false > type: string > - name: rules >@@ -34,7 +34,7 @@ > collectionFormat: multi > responses: > "200": >- description: A list of rules for this itemtype, library and patron category combination >+ description: A list of rules for this item type, library and patron category combination > schema: > type: object > additionalProperties: >diff --git a/t/db_dependent/api/v1/circulation_rules.t b/t/db_dependent/api/v1/circulation_rules.t >index bf35d24ba44..1c5e0a04ac3 100755 >--- a/t/db_dependent/api/v1/circulation_rules.t >+++ b/t/db_dependent/api/v1/circulation_rules.t >@@ -120,7 +120,7 @@ subtest 'list_effective_rules() tests' => sub { > "Given I added an issuing rule branchcode => $branchcode," . ' categorycode => undef, itemtype => undef,' > ); > >- $t->get_ok("//$userid:$password@/api/v1/circulation_rules?library=$branchcode")->status_is(200)->json_is( >+ $t->get_ok("//$userid:$password@/api/v1/circulation_rules?library_id=$branchcode")->status_is(200)->json_is( > '' => { > fine => 4, > finedays => 5, >@@ -141,7 +141,7 @@ subtest 'list_effective_rules() tests' => sub { > ->json_is( [ { path => '/query/rules_blah', message => 'Malformed query string' } ] ); > > # Warn on incorrect query parameter value >- $t->get_ok("//$userid:$password@/api/v1/circulation_rules?library=SMITH")->status_is(400)->json_is( >+ $t->get_ok("//$userid:$password@/api/v1/circulation_rules?library_id=SMITH")->status_is(400)->json_is( > '' => { > error => 'Invalid parameter value', > error_code => 'invalid_parameter_value', >-- >2.45.2
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 36641
:
165086
|
167937
|
167938
|
167946
|
167947
|
168018
|
168019
|
168020
|
168023
|
168024
|
168025
|
168365
|
168366
|
168367
|
168368
|
168369
|
168370
|
168378
|
168379
|
168395
|
168396
|
168397
|
168398
|
168399
|
168400
|
168401
|
168841
|
168874
|
168875
|
168876
|
168877
|
168878
|
168879
|
168880
|
168881
|
168882
|
168883
|
168884
|
168905
|
168906
|
168907
|
168908
|
168909
|
168910
|
168911
|
168912
|
168913
|
168914
|
168915
|
168916
|
168926
|
168927
|
168928
|
168929
|
168930
|
168931
|
168932
|
168933
|
168934
|
168935
|
168936
|
168937
|
168938
|
168940
|
169013
|
169014
|
169015
|
169016
|
169017
|
169018
|
169019
|
169020
|
169021
|
169022
|
169023
|
169024
|
169025
|
169026