refactor: serve same index page for all sort routes (hash-driven client-side)
This commit is contained in:
+4
-4
@@ -43,10 +43,10 @@ handleRequest recipes request respond =
|
||||
case Wai.pathInfo request of
|
||||
-- Index page (default: alphabetical)
|
||||
[] -> respond (htmlResponse (Html.indexPage Html.AlphaSort recipes))
|
||||
-- Index page (sorted by tags)
|
||||
["sorted", "tags"] -> respond (htmlResponse (Html.indexPage Html.TagSort recipes))
|
||||
-- Index page (sorted by course/category)
|
||||
["sorted", "course"] -> respond (htmlResponse (Html.indexPage Html.CourseSort recipes))
|
||||
-- Index page (sorted by tags) — sort mode ignored, driven client-side
|
||||
["sorted", "tags"] -> respond (htmlResponse (Html.indexPage Html.AlphaSort recipes))
|
||||
-- Index page (sorted by course/category) — sort mode ignored, driven client-side
|
||||
["sorted", "course"] -> respond (htmlResponse (Html.indexPage Html.AlphaSort recipes))
|
||||
-- Recipe detail page
|
||||
["recipes", rawPath] ->
|
||||
case lookupRecipe (urlDecodePath rawPath) recipes of
|
||||
|
||||
Reference in New Issue
Block a user