aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/app/Page/EditValue.hs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-06-07 17:08:01 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-06-08 09:56:20 +0200
commit2e67bf911533a66b5a5b7b50481b426adff8c7db (patch)
tree71481ebe7602ea3d5c84438d0ca829e26ca75a2a /frontend/app/Page/EditValue.hs
parent8a34cc822c2c508472fe29ab2be1b74ba06e59e6 (diff)
reload collections when creating
Diffstat (limited to 'frontend/app/Page/EditValue.hs')
-rw-r--r--frontend/app/Page/EditValue.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/frontend/app/Page/EditValue.hs b/frontend/app/Page/EditValue.hs
index d5a87e7..43c6f17 100644
--- a/frontend/app/Page/EditValue.hs
+++ b/frontend/app/Page/EditValue.hs
@@ -15,6 +15,7 @@ import Data.Maybe
import Form qualified as F
import Miso
import Miso.String (toMisoString)
+import Effect (Eff)
import Schema
data Model = Model
@@ -41,12 +42,12 @@ data Action
| EntityWritten (Either String ())
deriving (Eq, Show)
-updateModel :: Action -> Model -> Effect Action Model
-updateModel NoOp m = noEff m
-updateModel (FormChanged (Just -> input)) m = noEff m {input}
+updateModel :: Action -> Model -> (Effect Action Model, [Eff])
+updateModel NoOp m = (noEff m, [])
+updateModel (FormChanged (Just -> input)) m = (noEff m {input}, [])
updateModel (FormSubmitted output) m =
- m <# do EntityWritten <$> updatePost m.fileName output
-updateModel (EntityWritten _) m = noEff m
+ (m <# do EntityWritten <$> updatePost m.fileName output, [])
+updateModel (EntityWritten _) m = (noEff m, [])
viewModel :: Model -> View Action
viewModel m = do