|
Lines 50-56
Get one batch statuses
Link Here
|
| 50 |
sub get { |
50 |
sub get { |
| 51 |
my $c = shift->openapi->valid_input; |
51 |
my $c = shift->openapi->valid_input; |
| 52 |
|
52 |
|
| 53 |
my $status_code = $c->validation->param('illbatchstatus_code'); |
53 |
my $status_code = $c->param('illbatchstatus_code'); |
| 54 |
|
54 |
|
| 55 |
my $status = Koha::IllbatchStatuses->find( { code => $status_code } ); |
55 |
my $status = Koha::IllbatchStatuses->find( { code => $status_code } ); |
| 56 |
|
56 |
|
|
Lines 76-82
Add a new batch status
Link Here
|
| 76 |
sub add { |
76 |
sub add { |
| 77 |
my $c = shift->openapi->valid_input or return; |
77 |
my $c = shift->openapi->valid_input or return; |
| 78 |
|
78 |
|
| 79 |
my $body = $c->validation->param('body'); |
79 |
my $body = $c->req->json; |
| 80 |
|
80 |
|
| 81 |
my $status = Koha::IllbatchStatus->new($body); |
81 |
my $status = Koha::IllbatchStatus->new($body); |
| 82 |
|
82 |
|
|
Lines 107-113
Update a batch status
Link Here
|
| 107 |
sub update { |
107 |
sub update { |
| 108 |
my $c = shift->openapi->valid_input or return; |
108 |
my $c = shift->openapi->valid_input or return; |
| 109 |
|
109 |
|
| 110 |
my $status = Koha::IllbatchStatuses->find( { code => $c->validation->param('illbatchstatus_code') } ); |
110 |
my $status = Koha::IllbatchStatuses->find( { code => $c->param('illbatchstatus_code') } ); |
| 111 |
|
111 |
|
| 112 |
if ( not defined $status ) { |
112 |
if ( not defined $status ) { |
| 113 |
return $c->render( |
113 |
return $c->render( |
|
Lines 142-148
sub delete {
Link Here
|
| 142 |
|
142 |
|
| 143 |
my $c = shift->openapi->valid_input or return; |
143 |
my $c = shift->openapi->valid_input or return; |
| 144 |
|
144 |
|
| 145 |
my $status = Koha::IllbatchStatuses->find( { code => $c->validation->param('illbatchstatus_code') } ); |
145 |
my $status = Koha::IllbatchStatuses->find( { code => $c->param('illbatchstatus_code') } ); |
| 146 |
|
146 |
|
| 147 |
if ( not defined $status ) { |
147 |
if ( not defined $status ) { |
| 148 |
return $c->render( status => 404, openapi => { errors => [ { message => "ILL batch status not found" } ] } ); |
148 |
return $c->render( status => 404, openapi => { errors => [ { message => "ILL batch status not found" } ] } ); |