Skip to content

Commit

Permalink
update routing constraint for calendars
Browse files Browse the repository at this point in the history
There are three calendar paths:

* /bank-holidays
* /when-do-the-clocks-change
* /gwyliau-banc (Welsh language version of /bank-holidays)

The routing for the first two of these was previously done based on the content items (when the content item had a schema_name of calendar, it was picked up by this constraint. We are now going to publish these content items as special routes, in order to move them into special route publisher, and remove the calendar schema (since we don't publish anything substantive in the content item). This therefore updates the routing constraint to be based on these paths, rather than the schema.
  • Loading branch information
BeckaL committed Jun 28, 2023
1 parent 5ff14ca commit 9c74052
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
get "/gwyliau-banc", to: "calendar#show_calendar", defaults: { scope: "gwyliau-banc", locale: :cy }
get "/gwyliau-banc/:division", to: "calendar#division", defaults: { scope: "gwyliau-banc", locale: :cy }

constraints FormatRoutingConstraint.new("calendar") do
constraints(path: /(\/bank-holidays(\/*)?)|(\/when-do-the-clocks-change(\/*)?)/) do
get ":scope", to: "calendar#show_calendar", as: :calendar
get ":scope/:division", to: "calendar#division", as: :division
end
Expand Down

0 comments on commit 9c74052

Please sign in to comment.