View Transactions from a User on their page
This commit is contained in:
parent
cae2806ad2
commit
cd6c075588
2 changed files with 36 additions and 1 deletions
|
@ -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' );
|
||||
|
|
Reference in a new issue