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

(-)a/Koha/REST/V1/TransferLimits.pm (-5 / +12 lines)
Lines 128-137 sub batch_add { Link Here
128
    return try {
128
    return try {
129
        my $params = $c->req->json;
129
        my $params = $c->req->json;
130
130
131
        my @libraries = Koha::Libraries->search->as_list;
131
        my ( @from_branches, @to_branches );
132
132
        if ( $params->{from_library_id} ) {
133
        my @from_branches = $params->{from_library_id} ? $params->{from_library_id} : map { $_->id } @libraries;
133
            @from_branches = ( $params->{from_library_id} );
134
        my @to_branches = $params->{to_library_id} ? $params->{to_library_id} : map { $_->id } @libraries;
134
        }
135
        if ( $params->{to_library_id} ) {
136
            @to_branches = ( $params->{to_library_id} );
137
        }
138
        unless ( $params->{from_library_id} && $params->{to_library_id} ) {
139
            my @library_ids = Koha::Libraries->search->get_column('branchcode');
140
            @from_branches = @library_ids unless $params->{from_library_id};
141
            @to_branches   = @library_ids unless $params->{to_library_id};
142
        }
135
143
136
        my @results;
144
        my @results;
137
        foreach my $from ( @from_branches ) {
145
        foreach my $from ( @from_branches ) {
138
- 

Return to bug 36277