aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/app/Page.hs
diff options
context:
space:
mode:
authorLibravatar Kierán Meinhardt <kmein@posteo.de>2024-10-13 09:55:20 +0200
committerLibravatar Kierán Meinhardt <kmein@posteo.de>2024-10-13 09:55:24 +0200
commit962db630a81a4040902c23c773df3069a48db0a3 (patch)
tree65c2208cd0fe98aa8979080cb22b84edc35253ef /frontend/app/Page.hs
parent895772f1e76d0cdf12eba5a579ce889d585c9072 (diff)
move Collection types to common
Diffstat (limited to 'frontend/app/Page.hs')
-rw-r--r--frontend/app/Page.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/frontend/app/Page.hs b/frontend/app/Page.hs
index c7b393f..e1c8415 100644
--- a/frontend/app/Page.hs
+++ b/frontend/app/Page.hs
@@ -7,12 +7,14 @@ module Page
)
where
+import Collection
import Control.Monad.Catch (SomeException)
import Data.Bifunctor
import Data.Default
import Data.Function
import Effect (Eff)
import Miso
+import Miso.String (fromMisoString)
import Page.EditValue qualified as EditValue
import Page.ListCollection qualified as ListCollection
import Page.NewCollection qualified as NewCollection
@@ -34,9 +36,9 @@ instance Default Page where
initialPage :: Route -> JSM (Either SomeException Page)
initialPage Route.Home = pure (Right Home)
initialPage (Route.ListCollection c) =
- fmap ListCollection <$> ListCollection.initialModel c
+ fmap ListCollection <$> ListCollection.initialModel (Collection (fromMisoString c))
initialPage (Route.EditValue c f) =
- fmap EditValue <$> EditValue.initialModel c f
+ fmap EditValue <$> EditValue.initialModel (CollectionItem (Collection (fromMisoString c)) (fromMisoString f))
initialPage Route.NewCollection =
fmap NewCollection <$> NewCollection.initialModel