aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/My.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/App/Controller/My.pm
parent69ed1cda6a315a46e3309dcf3035ad7229931829 (diff)
Refactor duplicated filter_status code into a single function
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/My.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/My.pm16
1 files changed, 2 insertions, 14 deletions
diff --git a/perllib/FixMyStreet/App/Controller/My.pm b/perllib/FixMyStreet/App/Controller/My.pm
index 0bcee7ac6..b3d341a68 100644
--- a/perllib/FixMyStreet/App/Controller/My.pm
+++ b/perllib/FixMyStreet/App/Controller/My.pm
@@ -28,24 +28,12 @@ sub my : Path : Args(0) {
my $p_page = $c->req->params->{p} || 1;
my $u_page = $c->req->params->{u} || 1;
- my $states;
- $c->stash->{filter_status} = $c->cobrand->on_map_default_status;
- my $status = $c->req->param('status') || $c->cobrand->on_map_default_status;
- if ( $status eq 'all' ) {
- $states = FixMyStreet::DB::Result::Problem->visible_states();
- $c->stash->{filter_status} = 'all';
- } elsif ( $status eq 'open' ) {
- $states = FixMyStreet::DB::Result::Problem->open_states();
- $c->stash->{filter_status} = 'open';
- } elsif ( $status eq 'fixed' ) {
- $states = FixMyStreet::DB::Result::Problem->fixed_states();
- $c->stash->{filter_status} = 'fixed';
- }
+ $c->forward( '/reports/stash_report_filter_status' );
my $pins = [];
my $problems = {};
-
+ my $states = $c->stash->{filter_problem_states};
my $params = {
state => [ keys %$states ],
};