Bug 30719: (QA follow-up) c->validation fixes

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Pedro Amorim 2023-09-08 13:32:43 +00:00 committed by Tomas Cohen Arazi
parent fc83fb3ebb
commit 33ab6fc91c
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
3 changed files with 9 additions and 9 deletions

View File

@ -50,7 +50,7 @@ Get one batch statuses
sub get {
my $c = shift->openapi->valid_input;
my $status_code = $c->validation->param('illbatchstatus_code');
my $status_code = $c->param('illbatchstatus_code');
my $status = Koha::IllbatchStatuses->find( { code => $status_code } );
@ -76,7 +76,7 @@ Add a new batch status
sub add {
my $c = shift->openapi->valid_input or return;
my $body = $c->validation->param('body');
my $body = $c->req->json;
my $status = Koha::IllbatchStatus->new($body);
@ -107,7 +107,7 @@ Update a batch status
sub update {
my $c = shift->openapi->valid_input or return;
my $status = Koha::IllbatchStatuses->find( { code => $c->validation->param('illbatchstatus_code') } );
my $status = Koha::IllbatchStatuses->find( { code => $c->param('illbatchstatus_code') } );
if ( not defined $status ) {
return $c->render(
@ -142,7 +142,7 @@ sub delete {
my $c = shift->openapi->valid_input or return;
my $status = Koha::IllbatchStatuses->find( { code => $c->validation->param('illbatchstatus_code') } );
my $status = Koha::IllbatchStatuses->find( { code => $c->param('illbatchstatus_code') } );
if ( not defined $status ) {
return $c->render( status => 404, openapi => { errors => [ { message => "ILL batch status not found" } ] } );

View File

@ -106,7 +106,7 @@ Get one batch
sub get {
my $c = shift->openapi->valid_input;
my $batchid = $c->validation->param('illbatch_id');
my $batchid = $c->param('illbatch_id');
my $batch = Koha::Illbatches->find($batchid);
@ -143,7 +143,7 @@ Add a new batch
sub add {
my $c = shift->openapi->valid_input or return;
my $body = $c->validation->param('body');
my $body = $c->req->json;
# We receive cardnumber, so we need to look up the corresponding
# borrowernumber
@ -204,7 +204,7 @@ Update a batch
sub update {
my $c = shift->openapi->valid_input or return;
my $batch = Koha::Illbatches->find( $c->validation->param('illbatch_id') );
my $batch = Koha::Illbatches->find( $c->param('illbatch_id') );
if ( not defined $batch ) {
return $c->render(
@ -253,7 +253,7 @@ sub delete {
my $c = shift->openapi->valid_input or return;
my $batch = Koha::Illbatches->find( $c->validation->param('illbatch_id') );
my $batch = Koha::Illbatches->find( $c->param('illbatch_id') );
if ( not defined $batch ) {
return $c->render( status => 404, openapi => { error => "ILL batch not found" } );

View File

@ -72,7 +72,7 @@ sub add {
Koha::Database->new->schema->txn_do(
sub {
my $body = $c->validation->param('body');
my $body = $c->req->json;
$body->{backend} = delete $body->{ill_backend_id};
$body->{borrowernumber} = delete $body->{patron_id};
$body->{branchcode} = delete $body->{library_id};