Commit 0e18fb93 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] NodeList has hyperdata.

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