Commit 1217368e authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] NodeList has hyperdata.

parent 7195c28d
......@@ -38,4 +38,11 @@ instance decodeNodePoly :: (DecodeJson a)
, hyperdata: hyperdata'
}
newtype HyperdataList = HyperdataList { preferences :: String}
instance decodeHyperdataList :: DecodeJson HyperdataList where
decodeJson json = do
obj <- decodeJson json
pref <- obj .? "preferences"
pure $ HyperdataList { preferences : pref}
......@@ -26,7 +26,7 @@ endConfig = endConfig' V10
endConfig' :: ApiVersion -> EndConfig
endConfig' v = { front : frontRelative
, back : backDev v }
, back : backLocal v }
------------------------------------------------------------------------
frontRelative :: Config
......
......@@ -10,7 +10,7 @@ import React (ReactClass, ReactElement)
import Thermite (Spec, Render, simpleSpec, createClass, defaultPerformAction)
--------------------------------------------------------
import Gargantext.Prelude
import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Components.Node (NodePoly(..), HyperdataList(..))
import Gargantext.Components.Loader as Loader
import Gargantext.Components.Loader (createLoaderClass)
import Gargantext.Components.Table as Table
......@@ -60,7 +60,7 @@ getCorpus :: Int -> Aff CorpusData
getCorpus corpusId = do
corpusNode <- get $ toUrl Back Corpus $ Just corpusId
defaultListIds <- get $ toUrl Back (Children NodeList 0 1 Nothing) $ Just corpusId
case (head defaultListIds :: Maybe (NodePoly Unit)) of
case (head defaultListIds :: Maybe (NodePoly HyperdataList)) of
Just (NodePoly { id: defaultListId }) ->
pure {corpusNode, defaultListId}
Nothing ->
......
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