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

(-)a/Koha/REST/V1/Patrons.pm (-4 / +9 lines)
Lines 73-85 sub get { Link Here
73
73
74
    return try {
74
    return try {
75
        my $patron_id = $c->validation->param('patron_id');
75
        my $patron_id = $c->validation->param('patron_id');
76
        my $patron    = Koha::Patrons->find($patron_id);
76
        my $patron    = $c->objects->find( Koha::Patrons->new, $patron_id );
77
77
78
        unless ($patron) {
78
        unless ($patron) {
79
            return $c->render( status => 404, openapi => { error => "Patron not found." } );
79
            return $c->render(
80
                status  => 404,
81
                openapi => { error => "Patron not found." }
82
            );
80
        }
83
        }
81
84
82
        return $c->render( status => 200, openapi => $patron->to_api );
85
        return $c->render(
86
            status  => 200,
87
            openapi => $patron
88
        );
83
    }
89
    }
84
    catch {
90
    catch {
85
        $c->unhandled_exception($_);
91
        $c->unhandled_exception($_);
86
- 

Return to bug 27855