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

(-)a/Koha/REST/V1/Acquisitions/Funds.pm (-5 / +4 lines)
Lines 19-25 use Modern::Perl; Link Here
19
19
20
use Mojo::Base 'Mojolicious::Controller';
20
use Mojo::Base 'Mojolicious::Controller';
21
21
22
use C4::Budgets;
22
use Koha::Acquisition::Funds;
23
use JSON qw(to_json);
23
use JSON qw(to_json);
24
24
25
use Try::Tiny;
25
use Try::Tiny;
Lines 50-59 sub list_funds { Link Here
50
    }
50
    }
51
51
52
    return try {
52
    return try {
53
        my $funds = GetBudgets($filter);
53
        my @funds = Koha::Acquisition::Funds->search($filter);
54
        my @fundsArray = map { _to_api($_) } @$funds;
54
        @funds = map { _to_api($_->TO_JSON) } @funds;
55
        return $c->render( status  => 200,
55
        return $c->render( status  => 200,
56
                           openapi =>  \@fundsArray);
56
                           openapi =>  \@funds);
57
    }
57
    }
58
    catch {
58
    catch {
59
        if ( $_->isa('DBIx::Class::Exception') ) {
59
        if ( $_->isa('DBIx::Class::Exception') ) {
60
- 

Return to bug 19661