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

(-)a/Koha/REST/Plugin/Query.pm (-1 / +1 lines)
Lines 364-370 sub _parse_embed { Link Here
364
        $result->{$curr} = { children => _parse_embed( $next ) };
364
        $result->{$curr} = { children => _parse_embed( $next ) };
365
    }
365
    }
366
    else {
366
    else {
367
        if ( $curr =~ m/^(?<relation>.*)\+count/ ) {
367
        if ( $curr =~ m/^(?<relation>.*)[\+|:]count/ ) {
368
            my $key = $+{relation} . "_count";
368
            my $key = $+{relation} . "_count";
369
            $result->{$key} = { is_count => 1 };
369
            $result->{$key} = { is_count => 1 };
370
        }
370
        }
(-)a/t/Koha/REST/Plugin/Query.t (-2 / +4 lines)
Lines 433-439 subtest '_build_query_params_from_api' => sub { Link Here
433
433
434
subtest 'stash_embed() tests' => sub {
434
subtest 'stash_embed() tests' => sub {
435
435
436
    plan tests => 14;
436
    plan tests => 16;
437
437
438
    my $t = Test::Mojo->new;
438
    my $t = Test::Mojo->new;
439
439
Lines 446-451 subtest 'stash_embed() tests' => sub { Link Here
446
    $t->get_ok( '/stash_embed' => { 'x-koha-embed' => 'holds+count' } )
446
    $t->get_ok( '/stash_embed' => { 'x-koha-embed' => 'holds+count' } )
447
      ->json_is( '/embed' => { holds_count => { is_count => 1 } } );
447
      ->json_is( '/embed' => { holds_count => { is_count => 1 } } );
448
448
449
    $t->get_ok( '/stash_embed' => { 'x-koha-embed' => 'holds:count' } )
450
      ->json_is( '/embed' => { holds_count => { is_count => 1 } } );
451
449
    $t->get_ok( '/stash_embed' => { 'x-koha-embed' => 'checkouts,checkouts.item,patron' } )
452
    $t->get_ok( '/stash_embed' => { 'x-koha-embed' => 'checkouts,checkouts.item,patron' } )
450
      ->json_is( '/embed' => {
453
      ->json_is( '/embed' => {
451
            checkouts => { children => { item => {} } },
454
            checkouts => { children => { item => {} } },
452
- 

Return to bug 32118