aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map.pm
diff options
context:
space:
mode:
authorSteven Day <steve@mysociety.org>2015-06-29 12:06:11 +0100
committerSteven Day <steve@mysociety.org>2015-06-29 15:48:10 +0100
commitb2c41d9b9ac0444565cdc8b6dbbaeedf759185ba (patch)
treea2a755e57e92c3991c3681ae13d74347ddf0fb9c /perllib/FixMyStreet/Map.pm
parent69ed1cda6a315a46e3309dcf3035ad7229931829 (diff)
Refactor duplicated filter_status code into a single function
Diffstat (limited to 'perllib/FixMyStreet/Map.pm')
-rw-r--r--perllib/FixMyStreet/Map.pm12
1 files changed, 2 insertions, 10 deletions
diff --git a/perllib/FixMyStreet/Map.pm b/perllib/FixMyStreet/Map.pm
index 704b19bee..0fa23d081 100644
--- a/perllib/FixMyStreet/Map.pm
+++ b/perllib/FixMyStreet/Map.pm
@@ -119,16 +119,8 @@ sub map_pins {
my ( $min_lon, $min_lat, $max_lon, $max_lat ) = split /,/, $bbox;
my $category = $c->req->param('filter_category');
- # Filter reports by status, if present in query params
- my $states;
- my $status = $c->req->param('status') || $c->cobrand->on_map_default_status;
- if ( $status eq 'all' ) {
- $states = FixMyStreet::DB::Result::Problem->visible_states();
- } elsif ( $status eq 'open' ) {
- $states = FixMyStreet::DB::Result::Problem->open_states();
- } elsif ( $status eq 'fixed' ) {
- $states = FixMyStreet::DB::Result::Problem->fixed_states();
- }
+ $c->forward( '/reports/stash_report_filter_status' );
+ my $states = $c->stash->{filter_problem_states};
my ( $around_map, $around_map_list, $nearby, $dist ) =
FixMyStreet::Map::map_features_bounds( $c, $min_lon, $min_lat, $max_lon, $max_lat, $interval, $category, $states );