From 3c23c9a80271151e4060f2092439d068992a50d9 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 5 Aug 2011 17:43:07 +0100 Subject: Sort reports on My Reports page, whoops. --- perllib/FixMyStreet/App/Controller/My.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'perllib/FixMyStreet/App/Controller/My.pm') 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; -- cgit v1.2.3