alphagov / frontend

Serves the homepage, transactions and some index pages on GOV.UK
https://docs.publishing.service.gov.uk/apps/frontend.html
MIT License
38 stars 20 forks source link

Fix calendar param names #4307

Closed KludgeKML closed 3 weeks ago

KludgeKML commented 3 weeks ago

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

What

Improve / Simplify bank holiday routing

Why

Routing for bank holiday pages currently relies on a side-effect of other (correctly written) FormatRoutingConstraint blocks above it, has unnecessary explicit routes for the Gwyliau-banc pages, and always loads the content item twice from the API.

How

Fix the parameter from scope to slug and translate to scope only in the controller, remove the explicit gwyliau-banc routes that existed only to set the locale to Welsh on those pages and simply use the locale from the relevant content item. Finally, remove the overridden content_item method to use the ContentItemController default method, which utilises the data cached during routing, preventing a second call to the API for the same data.

Screenshots?

No visual differences