diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-08-05 17:43:07 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-08-05 17:43:07 +0100 |
commit | 3c23c9a80271151e4060f2092439d068992a50d9 (patch) | |
tree | faa1a55b08624e28952059ee6ec68d452b8a53ca /perllib/FixMyStreet/App/Controller/My.pm | |
parent | c63f13886f245a3778c5ae91c92fbe72e79379a3 (diff) |
Sort reports on My Reports page, whoops.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/My.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/My.pm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/My.pm b/perllib/FixMyStreet/App/Controller/My.pm index 19b3ffee0..e6062fe6c 100644 --- a/perllib/FixMyStreet/App/Controller/My.pm +++ b/perllib/FixMyStreet/App/Controller/My.pm @@ -30,8 +30,10 @@ sub my : Path : Args(0) { my $pins = []; my $problems = {}; - my $rs = $c->user->problems->search( undef, - { rows => 50 } )->page( $p_page ); + my $rs = $c->user->problems->search( undef, { + order_by => { -desc => 'confirmed' }, + rows => 50 + } )->page( $p_page ); while ( my $problem = $rs->next ) { push @$pins, { @@ -48,7 +50,10 @@ sub my : Path : Args(0) { $rs = $c->user->comments->search( { state => 'confirmed' }, - { rows => 50 } )->page( $u_page ); + { + order_by => { -desc => 'confirmed' }, + rows => 50 + } )->page( $u_page ); my @updates = $rs->all; $c->stash->{updates} = \@updates; $c->stash->{updates_pager} = $rs->pager; |