aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/app/Route.hs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-06-06 15:31:16 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-06-06 15:31:16 +0200
commit612da78d17c575cd5ade1de62dc1a3c514129de0 (patch)
treeedf00a2d0c55d869a1a717138c4b7ef6c290ef61 /frontend/app/Route.hs
parenta569f8d7a2da3b2769a3bbf3414c164043321dd7 (diff)
link to edit page from list page
Diffstat (limited to 'frontend/app/Route.hs')
-rw-r--r--frontend/app/Route.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/frontend/app/Route.hs b/frontend/app/Route.hs
index 18a3273..546939c 100644
--- a/frontend/app/Route.hs
+++ b/frontend/app/Route.hs
@@ -1,6 +1,7 @@
module Route
( Route (..),
parseURI,
+ routeToString,
)
where
@@ -32,3 +33,8 @@ parseURI uri =
<* P.endOfInput
)
(T.pack uri.uriFragment)
+
+routeToString :: Route -> String
+routeToString Home = "#"
+routeToString (ListCollection collection) = "#collection/" <> collection
+routeToString (EditValue collection fileName) = "#collection/" <> collection <> "/" <> fileName