Bugzilla – Attachment 151322 Details for
Bug 23336
Add an API endpoint for checking an item out to a patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23336: (QA follow-up) Some minor fixes
Bug-23336-QA-follow-up-Some-minor-fixes.patch (text/plain), 2.71 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-05-16 19:54:25 UTC
(
hide
)
Description:
Bug 23336: (QA follow-up) Some minor fixes
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-05-16 19:54:25 UTC
Size:
2.71 KB
patch
obsolete
>From b4cbe4da6955ee3f8ff9fdfd4a82d3f78ffcb376 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 16 May 2023 16:16:44 -0300 >Subject: [PATCH] Bug 23336: (QA follow-up) Some minor fixes > >This patch deals with some QA script warnings, and also makes some >changes in line with bug 33556. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/REST/V1/Checkouts.pm | 18 ++++++++---------- > 1 file changed, 8 insertions(+), 10 deletions(-) > >diff --git a/Koha/REST/V1/Checkouts.pm b/Koha/REST/V1/Checkouts.pm >index 7997941b3cb..d9650eb1b72 100644 >--- a/Koha/REST/V1/Checkouts.pm >+++ b/Koha/REST/V1/Checkouts.pm >@@ -111,10 +111,10 @@ Controller function that handles retrieval of Checkout availability > sub get_availability { > my $c = shift->openapi->valid_input or return; > >- my $patron = Koha::Patrons->find( $c->validation->param('patron_id') ); >+ my $patron = Koha::Patrons->find( $c->param('patron_id') ); > my $inprocess = 0; # What does this do? > my $ignore_reserves = 0; # Don't ignore reserves >- my $item = Koha::Items->find( $c->validation->param('item_id') ); >+ my $item = Koha::Items->find( $c->param('item_id') ); > my $params = { > item => $item > }; >@@ -123,9 +123,8 @@ sub get_availability { > C4::Circulation::CanBookBeIssued( $patron, undef, undef, $inprocess, $ignore_reserves, > $params ); > >- my $confirm_keys = join( /:/, sort keys %{$confirmation} ); >- my $tokenizer = Koha::Token->new; >- my $token = $tokenizer->generate_jwt({ id => $confirm_keys }); >+ my $confirm_keys = join( ":", sort keys %{$confirmation} ); >+ my $token = Koha::Token->new->generate_jwt({ id => $confirm_keys }); > > my $response = { > blockers => $impossible, >@@ -146,7 +145,7 @@ Add a new checkout > sub add { > my $c = shift->openapi->valid_input or return; > >- my $body = $c->validation->param('body'); >+ my $body = $c->req->json; > my $item_id = $body->{item_id}; > my $patron_id = $body->{patron_id}; > my $onsite = $body->{onsite_checkout}; >@@ -205,10 +204,9 @@ sub add { > > # Check for existance of confirmation token > # and if exists check validity >- if ( my $token = $c->validation->param('confirmation') ) { >- my $confirm_keys = join( /:/, sort keys %{$confirmation} ); >- my $tokenizer = Koha::Token->new; >- $confirmed = $tokenizer->check_jwt( >+ if ( my $token = $c->param('confirmation') ) { >+ my $confirm_keys = join( ":", sort keys %{$confirmation} ); >+ $confirmed = Koha::Token->new->check_jwt( > { id => $confirm_keys, token => $token } ); > } > >-- >2.40.1
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 23336
:
91632
|
91633
|
91634
|
150947
|
150948
|
150949
|
150954
|
150955
|
150956
|
150960
|
150961
|
150962
|
151253
|
151318
|
151319
|
151320
|
151321
|
151322
|
151353
|
151354
|
151355
|
151356
|
151357
|
152712
|
152713
|
152714
|
152715
|
152716
|
152938
|
152999
|
153000
|
153095
|
153096