diff --git a/lib/Pear/LocalLoop/Controller/Admin/Users.pm b/lib/Pear/LocalLoop/Controller/Admin/Users.pm index 803b68e..13905c6 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Users.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Users.pm @@ -33,7 +33,17 @@ sub read { my $id = $c->param('id'); if ( my $user = $c->user_result_set->find($id) ) { - $c->stash( user => $user ); + my $transactions = $user->entity->purchases->search( + undef, { + page => $c->param('page') || 1, + rows => 10, + order_by => { -desc => 'submitted_at' }, + }, + ); + $c->stash( + user => $user, + transactions => $transactions, + ); } else { $c->flash( error => 'No User found' ); $c->redirect_to( '/admin/users' ); diff --git a/templates/admin/users/read.html.ep b/templates/admin/users/read.html.ep index 149be12..37d7763 100644 --- a/templates/admin/users/read.html.ep +++ b/templates/admin/users/read.html.ep @@ -86,3 +86,28 @@ +