aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/ResultSet/Problem.pm
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2015-02-27 12:51:29 +0000
committerSteven Day <steve@mysociety.org>2015-06-29 12:43:00 +0100
commit09f94956ecd20a7aa861d0f7254189fd9373b813 (patch)
tree5e6077d201184446fa7676d8e5651e929a2827bb /perllib/FixMyStreet/DB/ResultSet/Problem.pm
parent8f3d63ae2c35d27b1ff8fe875b9fb6affadb0b57 (diff)
Add category filtering support to /ajax via 'category' GET param
Diffstat (limited to 'perllib/FixMyStreet/DB/ResultSet/Problem.pm')
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Problem.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
index 7a50a3146..affc6b177 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
@@ -131,7 +131,7 @@ sub _recent {
# Problems around a location
sub around_map {
- my ( $rs, $min_lat, $max_lat, $min_lon, $max_lon, $interval, $limit ) = @_;
+ my ( $rs, $min_lat, $max_lat, $min_lon, $max_lon, $interval, $limit, $category ) = @_;
my $attr = {
order_by => { -desc => 'created' },
};
@@ -145,6 +145,7 @@ sub around_map {
};
$q->{'current_timestamp - lastupdate'} = { '<', \"'$interval'::interval" }
if $interval;
+ $q->{category} = $category if $category;
my @problems = mySociety::Locale::in_gb_locale { $rs->search( $q, $attr )->all };
return \@problems;