aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/JSON.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-06-21 17:54:16 +0100
committerStruan Donald <struan@exo.org.uk>2011-06-21 17:54:16 +0100
commitddde474e6a1dfb1591e8cfe06dc05c8be3312853 (patch)
tree3b97c383534be926c4733aebf4b4228eb19c9013 /perllib/FixMyStreet/App/Controller/JSON.pm
parent2f3388de9ee449080febabd47876620c82d56895 (diff)
check for open states instead of confirmed
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/JSON.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/JSON.pm8
1 files changed, 4 insertions, 4 deletions
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 => [