From a3b842d044329b2b0eff876fdb07ad0ce983b1ac Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Fri, 27 Sep 2024 14:00:21 +0100 Subject: [PATCH] =?UTF-8?q?[Waste]=20Don=E2=80=99t=20call=20backend=20APIs?= =?UTF-8?q?=20for=20static=20template=20calendar=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- perllib/FixMyStreet/App/Controller/Waste.pm | 10 +++++++--- .../fixmystreet-uk-councils/about/waste-calendar.html | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/perllib/FixMyStreet/App/Controller/Waste.pm b/perllib/FixMyStreet/App/Controller/Waste.pm index 97168c94cb1..6f41b3794ab 100644 --- a/perllib/FixMyStreet/App/Controller/Waste.pm +++ b/perllib/FixMyStreet/App/Controller/Waste.pm @@ -568,9 +568,14 @@ sub csc_payment_failed : Path('csc_payment_failed') : Args(0) { $c->detach; } -sub property : Chained('/') : PathPart('waste') : CaptureArgs(1) { +sub property_id : Chained('/') : PathPart('waste') : CaptureArgs(1) { my ($self, $c, $id) = @_; + $c->stash->{property_id} = $id; +} +sub property : Chained('property_id') : PathPart('') : CaptureArgs(0) { + my ($self, $c) = @_; + my $id = $c->stash->{property_id}; # Some actions chained off /waste/property require user to be logged in. # The redirect to /auth does not work if it follows the asynchronous @@ -670,9 +675,8 @@ sub bin_day_deny : Private { $c->detach('/page_error_403_access_denied', [ $msg ]); } -sub calendar : Chained('property') : Args(0) { +sub calendar : Chained('property_id') : Args(0) { my ($self, $c) = @_; - $c->forward('/about/page', ['waste-calendar']); } diff --git a/templates/web/fixmystreet-uk-councils/about/waste-calendar.html b/templates/web/fixmystreet-uk-councils/about/waste-calendar.html index c5471860a6b..ccb46caefc7 100644 --- a/templates/web/fixmystreet-uk-councils/about/waste-calendar.html +++ b/templates/web/fixmystreet-uk-councils/about/waste-calendar.html @@ -1,6 +1,6 @@ [% PROCESS 'waste/header.html', title = 'Add your waste collection days to your online calendar'; -SET ics_link = c.uri_for_action('waste/calendar_ics', [ property.id ]); +SET ics_link = c.uri_for_action('waste/calendar_ics', [ property_id ]); %]