From 962db630a81a4040902c23c773df3069a48db0a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Sun, 13 Oct 2024 09:55:20 +0200 Subject: move Collection types to common --- frontend/app/Page.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'frontend/app/Page.hs') 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 -- cgit v1.2.3