Bug 21063: Add "Columns settings" for ILL
[koha.git] / Koha / REST / V1 / Illrequests.pm
index 94ff8ce..f8385a7 100644 (file)
@@ -15,6 +15,8 @@ package Koha::REST::V1::Illrequests;
 # with Koha; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+use Modern::Perl;
+
 use Mojo::Base 'Mojolicious::Controller';
 
 use Koha::Illrequests;
@@ -41,7 +43,7 @@ sub list {
 
     my $args = $c->req->params->to_hash // {};
     my $output = [];
-    my @format_dates = ( 'placed', 'updated' );
+    my @format_dates = ( 'placed', 'updated', 'completed' );
 
     # Create a hash where all keys are embedded values
     # Enables easy checking
@@ -125,9 +127,10 @@ sub list {
         foreach my $p(@{$patron_arr}) {
             if ($p->{borrowernumber} == $req->borrowernumber) {
                 $to_push->{patron} = {
-                    firstname  => $p->{firstname},
-                    surname    => $p->{surname},
-                    cardnumber => $p->{cardnumber}
+                    patron_id => $p->{borrowernumber},
+                    firstname      => $p->{firstname},
+                    surname        => $p->{surname},
+                    cardnumber     => $p->{cardnumber}
                 };
                 last;
             }