From 3efb66af9260e1d5f80b2c43af47eb4ed3e5c0e7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 5 Jan 2026 16:32:52 +0100 Subject: [PATCH] Bug 41456: Rename more item_type => item_type_id in hold's api spec Signed-off-by: Martin Renvoize --- Koha/REST/V1/Holds.pm | 4 ++-- api/v1/swagger/paths/holds.yaml | 2 +- t/db_dependent/api/v1/holds.t | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm index 4fdb604a707..c8892392189 100644 --- a/Koha/REST/V1/Holds.pm +++ b/Koha/REST/V1/Holds.pm @@ -81,7 +81,7 @@ sub add { my $pickup_library_id = $body->{pickup_library_id}; my $item_id = $body->{item_id}; my $patron_id = $body->{patron_id}; - my $item_type = $body->{item_type}; + my $item_type_id = $body->{item_type_id}; my $expiration_date = $body->{expiration_date}; my $notes = $body->{notes}; my $hold_date = $body->{hold_date}; @@ -209,7 +209,7 @@ sub add { title => $biblio->title, itemnumber => $item_id, found => undef, # TODO: Why not? - itemtype => $item_type, + itemtype => $item_type_id, non_priority => $non_priority, item_group_id => $item_group_id, confirmations => $confirmations, diff --git a/api/v1/swagger/paths/holds.yaml b/api/v1/swagger/paths/holds.yaml index dde7041a0eb..dcd6413c03a 100644 --- a/api/v1/swagger/paths/holds.yaml +++ b/api/v1/swagger/paths/holds.yaml @@ -201,7 +201,7 @@ type: - string - "null" - item_type: + item_type_id: description: Limit hold on one itemtype (ignored for item-level holds) type: - string diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t index a96ca9fe65b..e0f2183f53d 100755 --- a/t/db_dependent/api/v1/holds.t +++ b/t/db_dependent/api/v1/holds.t @@ -277,7 +277,7 @@ subtest 'Reserves with itemtype' => sub { patron_id => int( $patron_1->borrowernumber ), biblio_id => int( $biblio_1->biblionumber ), pickup_library_id => $branchcode, - item_type => $itemtype, + item_type_id => $itemtype, }; $t->delete_ok("//$userid_3:$password@/api/v1/holds/$reserve_id")->status_is( 204, 'REST3.2.4' ) @@ -294,7 +294,7 @@ subtest 'Reserves with itemtype' => sub { $reserve_id = $t->tx->res->json->{hold_id}; $t->get_ok( "//$userid_1:$password@/api/v1/holds?patron_id=" . $patron_1->borrowernumber )->status_is(200) - ->json_is( '/0/hold_id', $reserve_id )->json_is( '/0/item_type', $itemtype ); + ->json_is( '/0/hold_id', $reserve_id )->json_is( '/0/item_type_id', $itemtype ); }; subtest 'test AllowHoldDateInFuture' => sub { @@ -769,7 +769,7 @@ subtest 'add() tests (maxreserves behaviour)' => sub { patron_id => $patron->borrowernumber, biblio_id => $biblio_1->biblionumber, pickup_library_id => $item_1->home_branch->branchcode, - item_type => $item_1->itype, + item_type_id => $item_1->itype, }; $t->post_ok( "//$userid:$password@/api/v1/holds" => json => $post_data )->status_is(201); -- 2.52.0