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

(-)a/Koha/REST/V1/Holds.pm (-1 / +26 lines)
Lines 472-481 sub pickup_locations { Link Here
472
        }
472
        }
473
473
474
        my $pickup_locations = $c->objects->search( $ps_set );
474
        my $pickup_locations = $c->objects->search( $ps_set );
475
        my @response = ();
476
477
        if ( C4::Context->preference('AllowHoldPolicyOverride') ) {
478
479
            my $libraries_rs = Koha::Libraries->search( { pickup_location => 1 } );
480
            my $libraries    = $c->objects->search($libraries_rs);
481
482
            @response = map {
483
                my $library = $_;
484
                $library->{needs_override} = (
485
                    any { $_->{library_id} eq $library->{library_id} }
486
                    @{$pickup_locations}
487
                  )
488
                  ? Mojo::JSON->false
489
                  : Mojo::JSON->true;
490
                $library;
491
            } @{$libraries};
492
493
            return $c->render(
494
                status  => 200,
495
                openapi => \@response
496
            );
497
        }
498
499
        @response = map { $_->{needs_override} = Mojo::JSON->false; $_; } @{$pickup_locations};
475
500
476
        return $c->render(
501
        return $c->render(
477
            status  => 200,
502
            status  => 200,
478
            openapi => $pickup_locations
503
            openapi => \@response
479
        );
504
        );
480
    }
505
    }
481
    catch {
506
    catch {
(-)a/api/v1/swagger/definitions/library.json (-1 / +4 lines)
Lines 91-96 Link Here
91
    "smtp_server": {
91
    "smtp_server": {
92
        "type": ["object", "null"],
92
        "type": ["object", "null"],
93
        "description": "The library effective SMTP server"
93
        "description": "The library effective SMTP server"
94
    },
95
    "needs_override": {
96
        "type": "boolean",
97
        "description": "If the library needs an override to act as pickup location for a hold"
94
    }
98
    }
95
  },
99
  },
96
  "additionalProperties": false,
100
  "additionalProperties": false,
97
- 

Return to bug 27894