View | Details | Raw Unified | Return to bug 37253
Collapse All | Expand All

(-)a/Koha/REST/V1/Checkouts.pm (-4 / +4 lines)
Lines 205-211 sub add { Link Here
205
205
206
    return try {
206
    return try {
207
207
208
        unless ($item_id or $barcode){
208
        unless ( $item_id or $barcode ) {
209
            return $c->render(
209
            return $c->render(
210
                status  => 400,
210
                status  => 400,
211
                openapi => {
211
                openapi => {
Lines 216-226 sub add { Link Here
216
        }
216
        }
217
217
218
        my $item;
218
        my $item;
219
        if ($item_id){
219
        if ($item_id) {
220
            $item = Koha::Items->find($item_id);
220
            $item = Koha::Items->find($item_id);
221
        }
221
        }
222
        if ($barcode){
222
        if ($barcode) {
223
             $item = Koha::Items->find({ barcode => $barcode });
223
            $item = Koha::Items->find( { barcode => $barcode } );
224
        }
224
        }
225
        unless ($item) {
225
        unless ($item) {
226
            return $c->render(
226
            return $c->render(
(-)a/t/db_dependent/api/v1/checkouts.t (-2 / +2 lines)
Lines 492-498 subtest 'add checkout' => sub { Link Here
492
    $t->post_ok( "//$userid:$password@/api/v1/checkouts" => json => { item_id => $item1_id, patron_id => $patron_id } )
492
    $t->post_ok( "//$userid:$password@/api/v1/checkouts" => json => { item_id => $item1_id, patron_id => $patron_id } )
493
        ->status_is(201);
493
        ->status_is(201);
494
494
495
    $t->post_ok( "//$userid:$password@/api/v1/checkouts" => json => { external_id => $item1_barcode, patron_id => $patron_id } )
495
    $t->post_ok(
496
        "//$userid:$password@/api/v1/checkouts" => json => { external_id => $item1_barcode, patron_id => $patron_id } )
496
        ->status_is(201);
497
        ->status_is(201);
497
498
498
499
499
- 

Return to bug 37253