Commit 5de82556 authored by arturo's avatar arturo

>>> continue

parent 5302939d
Pipeline #2008 failed with stage
......@@ -6,7 +6,7 @@ import Gargantext.Prelude
import DOM.Simple.Console (log2)
import DOM.Simple.Event as DE
import Data.Array as A
import Data.Either (Either)
import Data.Either (Either(..))
import Data.Generic.Rep (class Generic)
import Data.Lens ((^.))
import Data.Lens.At (at)
......@@ -146,24 +146,18 @@ docViewCpt = here.component "docView" cpt where
T.modify_ not isDocumentModalVisibleBox
-- @createDocumentCallback
-- @WIP: remote business for document creation
createDocumentCallback <- pure $ \fdata -> launchAff_ do
-- liftEffect $ T.write_ true onDocumentCreationPendingBox
-- delay $ Milliseconds 2000.0
-- liftEffect $ T.write_ false onDocumentCreationPendingBox
liftEffect $
T.write_ true onDocumentCreationPendingBox
res <- DFC.create session nodeId fdata
liftEffect do
log2 "RESULT" res
T.write_ false onDocumentCreationPendingBox
liftEffect $ case res of
Left err -> do
log2 "createDocumentCallback error" err
T.write_ false onDocumentCreationPendingBox
Right _ -> pure unit -- @WIP reload page
-- Render
pure $
......
......@@ -54,7 +54,7 @@ component = R.hooksComponent "documentFormCreation" cpt where
result <- fv.try (\_ -> documentFormValidation state)
case result of
Left err -> log3 "document form validation error" state err
Left err -> log3 "documentFormCreation validation error" state err
Right _ -> props.callback state
-- Render
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment