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

(-)a/Koha/REST/V1/Holds.pm (-2 / +2 lines)
Lines 282-289 sub edit { Link Here
282
        # suspended_until can also be set to undef
282
        # suspended_until can also be set to undef
283
        my $suspended_until =
283
        my $suspended_until =
284
          exists $body->{suspended_until}
284
          exists $body->{suspended_until}
285
          ? dt_from_string( $body->{suspended_until}, 'rfc3339' )
285
          ? $body->{suspended_until} && dt_from_string( $body->{suspended_until}, 'rfc3339' )
286
          : dt_from_string( $hold->suspend_until,     'iso' );
286
          : $hold->suspend_until     && dt_from_string( $hold->suspend_until,     'iso' );
287
287
288
        my $params = {
288
        my $params = {
289
            reserve_id    => $hold_id,
289
            reserve_id    => $hold_id,
(-)a/t/db_dependent/api/v1/holds.t (-2 / +7 lines)
Lines 892-898 subtest 'pickup_locations() tests' => sub { Link Here
892
892
893
subtest 'edit() tests' => sub {
893
subtest 'edit() tests' => sub {
894
894
895
    plan tests => 37;
895
    plan tests => 39;
896
896
897
    $schema->storage->txn_begin;
897
    $schema->storage->txn_begin;
898
898
Lines 1010-1015 subtest 'edit() tests' => sub { Link Here
1010
                branchcode   => $library_3->branchcode,
1010
                branchcode   => $library_3->branchcode,
1011
                itemnumber   => $item->itemnumber,
1011
                itemnumber   => $item->itemnumber,
1012
                priority     => 1,
1012
                priority     => 1,
1013
                suspend       => 0,
1014
                suspend_until => undef,
1013
            }
1015
            }
1014
        }
1016
        }
1015
    );
1017
    );
Lines 1061-1067 subtest 'edit() tests' => sub { Link Here
1061
    $item_hold->discard_changes;
1063
    $item_hold->discard_changes;
1062
    is( $item_hold->branchcode, $library_2->id, 'Pickup location changed correctly' );
1064
    is( $item_hold->branchcode, $library_2->id, 'Pickup location changed correctly' );
1063
1065
1066
    is( $item_hold->suspend, 0, 'Location change should not activate suspended status' );
1067
    is( $item_hold->suspend_until, undef, 'Location change should keep suspended_until be undef' );
1068
1064
    $schema->storage->txn_rollback;
1069
    $schema->storage->txn_rollback;
1070
1065
};
1071
};
1066
1072
1067
subtest 'add() tests' => sub {
1073
subtest 'add() tests' => sub {
1068
- 

Return to bug 29906