aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App
diff options
context:
space:
mode:
authorpezholio <pezholio@gmail.com>2017-01-30 14:54:50 +0000
committerpezholio <pezholio@gmail.com>2017-01-31 13:57:17 +0000
commit111acf7ccb452a7c163682b73b9cf5aee5f98be1 (patch)
tree388dd8d16937431d5e94d27a35111e08484085ab /perllib/FixMyStreet/App
parent81e725393821f4aa39007f67c3aba01e8a058d7c (diff)
Return JSON if `ajax` in params
Diffstat (limited to 'perllib/FixMyStreet/App')
-rw-r--r--perllib/FixMyStreet/App/Controller/My.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/My.pm b/perllib/FixMyStreet/App/Controller/My.pm
index c26cdd5c8..ffcdf829d 100644
--- a/perllib/FixMyStreet/App/Controller/My.pm
+++ b/perllib/FixMyStreet/App/Controller/My.pm
@@ -56,6 +56,10 @@ sub planned : Local : Args(0) {
$c->forward('planned_reorder');
$c->forward('/reports/stash_report_sort', [ 'shortlist' ]);
$c->forward('get_problems');
+ if ($c->get_param('ajax')) {
+ $c->stash->{shortlist} = $c->stash->{sort_key} eq 'shortlist';
+ $c->detach('/reports/ajax', [ 'my/_problem-list.html' ]);
+ }
$c->forward('setup_page_data');
}