diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-05-02 17:05:43 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-05-08 15:32:12 +0100 |
commit | 505953fc71a6142826e1e5743a0a3dc18e306748 (patch) | |
tree | 79bb4371dee529c70a98ef8160da3d412a161d0f /perllib/FixMyStreet/App/Controller/Around.pm | |
parent | ba16e095260993d814e6fb603a7d405d08a4ecb9 (diff) |
Remove needless category mappings.
Both filter categories and new report category lists went through mappings
to different data structures, which doesn't seem to be needed.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Around.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index bdf381294..184d61f4f 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -228,7 +228,7 @@ sub check_and_stash_category : Private { my @bodies = $c->model('DB::Body')->active->for_areas(keys %$all_areas)->all; my %bodies = map { $_->id => $_ } @bodies; - my @contacts = $c->model('DB::Contact')->not_deleted->search( + my @categories = $c->model('DB::Contact')->not_deleted->search( { body_id => [ keys %bodies ], }, @@ -238,9 +238,8 @@ sub check_and_stash_category : Private { distinct => 1 } )->all; - my @categories = map { { name => $_->category, value => $_->category_display } } @contacts; $c->stash->{filter_categories} = \@categories; - my %categories_mapped = map { $_->{name} => 1 } @categories; + my %categories_mapped = map { $_->category => 1 } @categories; my $categories = [ $c->get_param_list('filter_category', 1) ]; my %valid_categories = map { $_ => 1 } grep { $_ && $categories_mapped{$_} } @$categories; |