add edit page

This commit is contained in:
Alexander Foremny
2024-06-05 10:41:02 +02:00
parent d5f3f2333a
commit a7a4dd0112
7 changed files with 111 additions and 6 deletions

View File

@@ -12,6 +12,7 @@ import Miso
data Route
= Home
| ListCollection String
| EditValue String String
deriving (Show, Eq)
instance Default Route where
@@ -22,7 +23,10 @@ parseURI uri =
either (const def) id $
P.parseOnly
( P.choice
[ ListCollection <$> (P.string "#collection/" *> P.many1 P.anyChar),
[ EditValue
<$> (P.string "#collection/" *> P.manyTill P.anyChar (P.string "/"))
<*> (P.many1 P.anyChar),
ListCollection <$> (P.string "#collection/" *> P.many1 P.anyChar),
pure Home
]
<* P.endOfInput