From 7165c186b0ac7e92b0c7c053a2f8fbc1e7d93ad7 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 17 Nov 2021 18:09:02 -0300 Subject: [PATCH] Bug 29510: (follow-up) Adapt GET /patrons/:patron_id This patch makes GET /patrons/:patron_id rely on this new behavior from the objects.find helper. To test: 1. Run: $ kshell k$ prove t/db_dependent/api/v1/patrons.t => SUCCESS: Tests pass! 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests still pass! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Marcel de Rooy Signed-off-by: Wainui Witika-Park --- Koha/REST/V1/Patrons.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/REST/V1/Patrons.pm b/Koha/REST/V1/Patrons.pm index 576e4f8f2c..7d0817b637 100644 --- a/Koha/REST/V1/Patrons.pm +++ b/Koha/REST/V1/Patrons.pm @@ -74,8 +74,8 @@ sub get { my $c = shift->openapi->valid_input or return; return try { - my $patron_id = $c->validation->param('patron_id'); - my $patron = $c->objects->find( Koha::Patrons->search_limited, $patron_id ); + my $patron_id = $c->param('patron_id'); + my $patron = $c->objects->find( Koha::Patrons->new, $patron_id ); unless ($patron) { return $c->render( -- 2.39.5