diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-12-14 19:07:08 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-12-19 14:43:26 +0000 |
commit | ddf9dbdbf6486c781ca4a5822614b0b7cee2c062 (patch) | |
tree | 09c12affc3390138b03292d3f90810287b4941d0 /perllib/FixMyStreet/App/Controller/Dashboard.pm | |
parent | da29e8a75eaa92e98807ad89d29d3d1f3c01bc14 (diff) |
Allow bodies to span multiple area IDs, and areas can be covered by more than one body.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Dashboard.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Dashboard.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm index 3a66cf1e0..657751e5c 100644 --- a/perllib/FixMyStreet/App/Controller/Dashboard.pm +++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm @@ -92,15 +92,18 @@ sub index : Path : Args(0) { # Set up the data for the dropdowns - my $council_detail = mySociety::MaPit::call('area', $body->area_id ); + # Just take the first area ID we find + my $area_id = $body->body_areas->first->area_id; + + my $council_detail = mySociety::MaPit::call('area', $area_id ); $c->stash->{council} = $council_detail; - my $children = mySociety::MaPit::call('area/children', $body->area_id, + my $children = mySociety::MaPit::call('area/children', $area_id, type => $c->cobrand->area_types_children, ); $c->stash->{children} = $children; - $c->stash->{all_areas} = { $body->area_id => $council_detail }; + $c->stash->{all_areas} = { $area_id => $council_detail }; $c->forward( '/report/new/setup_categories_and_bodies' ); # See if we've had anything from the dropdowns |