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

(-)a/api/v1/swagger/paths/holds.yaml (-4 / +10 lines)
Lines 680-692 Link Here
680
        schema:
680
        schema:
681
          $ref: "../swagger.yaml#/definitions/error"
681
          $ref: "../swagger.yaml#/definitions/error"
682
      "409":
682
      "409":
683
        description: Unable to perform action on hold
683
        description: |
684
          Unable to perform action on hold. Possible `error_code` attribute values:
685
686
          * `hold_waiting`
687
          * `hold_in_transit`
688
          * `hold_in_processing`
684
        schema:
689
        schema:
685
          $ref: "../swagger.yaml#/definitions/error"
690
          $ref: "../swagger.yaml#/definitions/error"
686
      "500":
691
      "500":
687
        description: Internal error
692
        description: |
688
        schema:
693
          Internal server error. Possible `error_code` attribute values:
689
          $ref: "../swagger.yaml#/definitions/error"
694
695
          * `internal_server_error`
690
      "503":
696
      "503":
691
        description: Under maintenance
697
        description: Under maintenance
692
        schema:
698
        schema:
(-)a/t/db_dependent/api/v1/holds.t (-2 / +20 lines)
Lines 1270-1276 subtest 'add() tests' => sub { Link Here
1270
1270
1271
subtest 'PUT /holds/{hold_id}/pickup_location tests' => sub {
1271
subtest 'PUT /holds/{hold_id}/pickup_location tests' => sub {
1272
1272
1273
    plan tests => 28;
1273
    plan tests => 37;
1274
1274
1275
    $schema->storage->txn_begin;
1275
    $schema->storage->txn_begin;
1276
1276
Lines 1403-1408 subtest 'PUT /holds/{hold_id}/pickup_location tests' => sub { Link Here
1403
1403
1404
    is( $hold->discard_changes->branchcode->branchcode, $library_2->branchcode, 'invalid pickup library not used, even if x-koha-override is passed' );
1404
    is( $hold->discard_changes->branchcode->branchcode, $library_2->branchcode, 'invalid pickup library not used, even if x-koha-override is passed' );
1405
1405
1406
    my $waiting_hold       = $builder->build_object( { class => 'Koha::Holds', value => { found => 'W' } } );
1407
    my $in_processing_hold = $builder->build_object( { class => 'Koha::Holds', value => { found => 'P' } } );
1408
    my $in_transit_hold    = $builder->build_object( { class => 'Koha::Holds', value => { found => 'T' } } );
1409
1410
    $t->put_ok( "//$userid:$password@/api/v1/holds/"
1411
            . $waiting_hold->id
1412
            . "/pickup_location" => json => { pickup_library_id => $library_2->branchcode } )->status_is(409)
1413
        ->json_is( { error => q{Cannot change pickup location}, error_code => 'hold_waiting' } );
1414
1415
    $t->put_ok( "//$userid:$password@/api/v1/holds/"
1416
            . $in_processing_hold->id
1417
            . "/pickup_location" => json => { pickup_library_id => $library_2->branchcode } )->status_is(409)
1418
        ->json_is( { error => q{Cannot change pickup location}, error_code => 'hold_in_processing' } );
1419
1420
    $t->put_ok( "//$userid:$password@/api/v1/holds/"
1421
            . $in_transit_hold->id
1422
            . "/pickup_location" => json => { pickup_library_id => $library_2->branchcode } )->status_is(409)
1423
        ->json_is( { error => q{Cannot change pickup location}, error_code => 'hold_in_transit' } );
1424
1406
    $schema->storage->txn_rollback;
1425
    $schema->storage->txn_rollback;
1407
};
1426
};
1408
1427
1409
- 

Return to bug 34024