import Gargantext.Core.Types (Name)
import Gargantext.Database.Admin.Types.Hyperdata
import Gargantext.Database.Admin.Types.Node
-import Gargantext.Database.Prelude (Cmd)
import Gargantext.Database.Query.Table.Node
import Gargantext.Database.Query.Table.Node.Error
import Gargantext.Database.Query.Table.Node.UpdateOpaleye (updateHyperdata)
import Gargantext.Prelude
-import Gargantext.Core.Crypto.Hash (hash)
+import Gargantext.Prelude.Crypto.Hash (hash)
import Gargantext.Database.Prelude
import Control.Lens (view)
-import Gargantext.Config (GargConfig(..))
+import Gargantext.Prelude.Config (GargConfig(..))
------------------------------------------------------------------------
-- | TODO mk all others nodes
case maybeNodeId of
[] -> nodeError (DoesNotExist i)
[n] -> do
- config <- view hasConfig
+ cfg <- view config
u <- case nt of
- NodeFrameWrite -> pure $ _gc_frame_write_url config
- NodeFrameCalc -> pure $ _gc_frame_calc_url config
+ NodeFrameWrite -> pure $ _gc_frame_write_url cfg
+ NodeFrameCalc -> pure $ _gc_frame_calc_url cfg
_ -> nodeError NeedsConfiguration
let
- s = _gc_secretkey config
+ s = _gc_secretkey cfg
hd = HyperdataFrame u (hash $ s <> (cs $ show n))
_ <- updateHyperdata n hd
pure [n]