aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/ResultSet/Nearby.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/DB/ResultSet/Nearby.pm')
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Nearby.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/Nearby.pm b/perllib/FixMyStreet/DB/ResultSet/Nearby.pm
index 06aca26db..a0ccb8a6d 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Nearby.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Nearby.pm
@@ -5,11 +5,15 @@ use strict;
use warnings;
sub nearby {
- my ( $rs, $c, $dist, $ids, $limit, $mid_lat, $mid_lon, $interval, $category ) = @_;
+ my ( $rs, $c, $dist, $ids, $limit, $mid_lat, $mid_lon, $interval, $category, $states ) = @_;
+
+ unless ( $states ) {
+ $states = FixMyStreet::DB::Result::Problem->visible_states();
+ }
my $params = {
non_public => 0,
- state => [ FixMyStreet::DB::Result::Problem::visible_states() ],
+ state => [ keys %$states ],
};
$params->{'current_timestamp-lastupdate'} = { '<', \"'$interval'::interval" }
if $interval;