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

(-)a/Koha/REST/V1/Biblios.pm (-4 / +6 lines)
Lines 798-813 Controller function that handles retrieving a single biblio object Link Here
798
sub list {
798
sub list {
799
    my $c = shift->openapi->valid_input or return;
799
    my $c = shift->openapi->valid_input or return;
800
800
801
    my $deleted = delete $c->validation->output->{deleted};
801
    my $deleted = $c->param('deleted');
802
    $c->req->params->remove('deleted');
802
803
803
    my $attributes;
804
    my $attributes;
804
    $attributes =
805
    $attributes =
805
      { prefetch => ['metadata'] }    # don't prefetch metadata if not needed
806
      { prefetch => ['metadata'] }    # don't prefetch metadata if not needed
806
      unless $c->req->headers->accept =~ m/application\/json/;
807
      unless $c->req->headers->accept =~ m/application\/json/;
807
808
808
    my $biblios = $deleted ?
809
    my $biblios =
809
        $c->objects->search_rs( Koha::Old::Biblios->new ) :
810
          $deleted
810
        $c->objects->search_rs( Koha::Biblios->new );
811
        ? $c->objects->search_rs( Koha::Old::Biblios->new )
812
        : $c->objects->search_rs( Koha::Biblios->new );
811
813
812
    return try {
814
    return try {
813
815
(-)a/t/db_dependent/api/v1/biblios.t (-3 / +3 lines)
Lines 29-34 use t::lib::Mocks; Link Here
29
use t::lib::TestBuilder;
29
use t::lib::TestBuilder;
30
30
31
use C4::Auth;
31
use C4::Auth;
32
use C4::Biblio qw( DelBiblio );
32
use C4::Circulation qw( AddIssue AddReturn );
33
use C4::Circulation qw( AddIssue AddReturn );
33
34
34
use Koha::Biblios;
35
use Koha::Biblios;
Lines 1687-1694 subtest 'list() tests' => sub { Link Here
1687
          { Accept => 'text/plain', 'x-koha-query' => $search } )
1688
          { Accept => 'text/plain', 'x-koha-query' => $search } )
1688
      ->status_is(200);
1689
      ->status_is(200);
1689
1690
1690
    $biblio->delete;
1691
    DelBiblio( $biblio->id );
1691
    $biblio2->delete;
1692
    DelBiblio( $biblio2->id );
1692
1693
1693
    $t->get_ok( "//$userid:$password@/api/v1/biblios/?deleted=1" =>
1694
    $t->get_ok( "//$userid:$password@/api/v1/biblios/?deleted=1" =>
1694
          { Accept => 'application/json', 'x-koha-query' => $search } )
1695
          { Accept => 'application/json', 'x-koha-query' => $search } )
1695
- 

Return to bug 33960