aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/app/Route.hs
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/Route.hs')
-rw-r--r--frontend/app/Route.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/frontend/app/Route.hs b/frontend/app/Route.hs
index 546939c..d683b76 100644
--- a/frontend/app/Route.hs
+++ b/frontend/app/Route.hs
@@ -14,6 +14,7 @@ data Route
= Home
| ListCollection String
| EditValue String String
+ | NewCollection
deriving (Show, Eq)
instance Default Route where
@@ -27,6 +28,7 @@ parseURI uri =
[ EditValue
<$> (P.string "#collection/" *> P.manyTill P.anyChar (P.string "/"))
<*> (P.many1 P.anyChar),
+ pure NewCollection <* (P.string "#collection/new"),
ListCollection <$> (P.string "#collection/" *> P.many1 P.anyChar),
pure Home
]
@@ -38,3 +40,4 @@ routeToString :: Route -> String
routeToString Home = "#"
routeToString (ListCollection collection) = "#collection/" <> collection
routeToString (EditValue collection fileName) = "#collection/" <> collection <> "/" <> fileName
+routeToString NewCollection = "#collection/new"