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

(-)a/Koha/REST/V1/Holds.pm (-1 / +26 lines)
Lines 473-482 sub pickup_locations { Link Here
473
        }
473
        }
474
474
475
        my $pickup_locations = $c->objects->search( $ps_set );
475
        my $pickup_locations = $c->objects->search( $ps_set );
476
        my @response = ();
477
478
        if ( C4::Context->preference('AllowHoldPolicyOverride') ) {
479
480
            my $libraries_rs = Koha::Libraries->search( { pickup_location => 1 } );
481
            my $libraries    = $c->objects->search($libraries_rs);
482
483
            @response = map {
484
                my $library = $_;
485
                $library->{needs_override} = (
486
                    any { $_->{library_id} eq $library->{library_id} }
487
                    @{$pickup_locations}
488
                  )
489
                  ? Mojo::JSON->false
490
                  : Mojo::JSON->true;
491
                $library;
492
            } @{$libraries};
493
494
            return $c->render(
495
                status  => 200,
496
                openapi => \@response
497
            );
498
        }
499
500
        @response = map { $_->{needs_override} = Mojo::JSON->false; $_; } @{$pickup_locations};
476
501
477
        return $c->render(
502
        return $c->render(
478
            status  => 200,
503
            status  => 200,
479
            openapi => $pickup_locations
504
            openapi => \@response
480
        );
505
        );
481
    }
506
    }
482
    catch {
507
    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