From ddde474e6a1dfb1591e8cfe06dc05c8be3312853 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Tue, 21 Jun 2011 17:54:16 +0100 Subject: check for open states instead of confirmed --- perllib/FixMyStreet/App/Controller/JSON.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'perllib/FixMyStreet/App/Controller/JSON.pm') diff --git a/perllib/FixMyStreet/App/Controller/JSON.pm b/perllib/FixMyStreet/App/Controller/JSON.pm index 3a3010911..d9baeaaf8 100644 --- a/perllib/FixMyStreet/App/Controller/JSON.pm +++ b/perllib/FixMyStreet/App/Controller/JSON.pm @@ -70,12 +70,12 @@ sub problems : Local { } # query the database - my ( $state, $date_col ); + my ( @state, $date_col ); if ( $type eq 'new_problems' ) { - $state = 'confirmed'; + @state = FixMyStreet::DB::Result::Problem->open_states(); $date_col = 'created'; } elsif ( $type eq 'fixed_problems' ) { - $state = 'fixed'; + @state = FixMyStreet::DB::Result::Problem->fixed_states(); $date_col = 'lastupdate'; } @@ -85,7 +85,7 @@ sub problems : Local { '>=' => $start_dt, '<=' => $end_dt + $one_day, }, - state => $state, + state => [ @state ], }, { order_by => { -asc => 'confirmed' }, columns => [ -- cgit v1.2.3