diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-02-20 14:08:33 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-02-25 12:19:50 +0000 |
commit | 0c8aae1ab17617f46f400bab81bb7a3b144b4a1e (patch) | |
tree | 61395979a0dad8a235a7b0c8bf505bc55acd5aef /perllib/FixMyStreet/App/Controller/Around.pm | |
parent | 66f2160d3718f049a3772f2f69f623971295f547 (diff) |
Internal JSON endpoint to get reports near a point
Unused right now, but will be soon, for the duplicate suggestion UI.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Around.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 4c68ce414..a09161494 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -317,6 +317,18 @@ sub ajax : Path('/ajax') { $c->forward('/reports/ajax', [ 'around/on_map_list_items.html' ]); } +sub nearby : Path { + my ($self, $c) = @_; + + my $states = FixMyStreet::DB::Result::Problem->open_states(); + $c->forward('/report/_nearby_json', [ { + latitude => $c->get_param('latitude'), + longitude => $c->get_param('longitude'), + categories => [ $c->get_param('filter_category') || () ], + states => $states, + } ]); +} + sub location_closest_address : Path('/ajax/closest') { my ( $self, $c ) = @_; $c->res->content_type('application/json; charset=utf-8'); |