|
Lines 20-25
use Modern::Perl;
Link Here
|
| 20 |
use Mojo::Base 'Mojolicious::Controller'; |
20 |
use Mojo::Base 'Mojolicious::Controller'; |
| 21 |
|
21 |
|
| 22 |
use Koha::Biblios; |
22 |
use Koha::Biblios; |
|
|
23 |
use Koha::Old::Biblios; |
| 23 |
use Koha::DateUtils; |
24 |
use Koha::DateUtils; |
| 24 |
use Koha::Ratings; |
25 |
use Koha::Ratings; |
| 25 |
use Koha::RecordProcessor; |
26 |
use Koha::RecordProcessor; |
|
Lines 797-808
Controller function that handles retrieving a single biblio object
Link Here
|
| 797 |
sub list { |
798 |
sub list { |
| 798 |
my $c = shift->openapi->valid_input or return; |
799 |
my $c = shift->openapi->valid_input or return; |
| 799 |
|
800 |
|
|
|
801 |
my $deleted = delete $c->validation->output->{deleted}; |
| 802 |
|
| 800 |
my $attributes; |
803 |
my $attributes; |
| 801 |
$attributes = |
804 |
$attributes = |
| 802 |
{ prefetch => ['metadata'] } # don't prefetch metadata if not needed |
805 |
{ prefetch => ['metadata'] } # don't prefetch metadata if not needed |
| 803 |
unless $c->req->headers->accept =~ m/application\/json/; |
806 |
unless $c->req->headers->accept =~ m/application\/json/; |
| 804 |
|
807 |
|
| 805 |
my $biblios = $c->objects->search_rs( Koha::Biblios->new ); |
808 |
my $biblios = $deleted ? |
|
|
809 |
$c->objects->search_rs( Koha::Old::Biblios->new ) : |
| 810 |
$c->objects->search_rs( Koha::Biblios->new ); |
| 806 |
|
811 |
|
| 807 |
return try { |
812 |
return try { |
| 808 |
|
813 |
|