}
my $pickup_locations = $c->objects->search( $ps_set );
my @response = ();
if ( C4::Context->preference('AllowHoldPolicyOverride') ) {
my $libraries_rs = Koha::Libraries->search( { pickup_location => 1 } );
my $libraries = $c->objects->search($libraries_rs);
@response = map {
my $library = $_;
$library->{needs_override} = (
any { $_->{library_id} eq $library->{library_id} }
@{$pickup_locations}
)
? Mojo::JSON->false
: Mojo::JSON->true;
$library;
} @{$libraries};
return $c->render(
status => 200,
openapi => \@response
);
@response = map { $_->{needs_override} = Mojo::JSON->false; $_; } @{$pickup_locations};
openapi => $pickup_locations
catch {
"smtp_server": {
"type": ["object", "null"],
"description": "The library effective SMTP server"
},
"needs_override": {
"type": "boolean",
"description": "If the library needs an override to act as pickup location for a hold"
"additionalProperties": false,
-