Commit 233539c3 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] Hyperdata of Documents

parent bc39b467
...@@ -104,14 +104,12 @@ home = map node_id <$> Cmd (ReaderT (getNodesWithParentId 0 Nothing)) ...@@ -104,14 +104,12 @@ home = map node_id <$> Cmd (ReaderT (getNodesWithParentId 0 Nothing))
ls :: PWD -> Cmd [Node Value] ls :: PWD -> Cmd [Node Value]
ls = get ls = get
tree :: PWD -> Cmd [Node Value] tree :: PWD -> Cmd [Node Value]
tree p = do tree p = do
ns <- get p ns <- get p
children <- mapM (\n -> get [node_id n]) ns children <- mapM (\n -> get [node_id n]) ns
pure $ ns <> concat children pure $ ns <> concat children
-- | TODO -- | TODO
post :: PWD -> [NodeWrite'] -> Cmd Int64 post :: PWD -> [NodeWrite'] -> Cmd Int64
post [] _ = pure 0 post [] _ = pure 0
...@@ -164,8 +162,6 @@ postAnnuaire corpusName title ns = do ...@@ -164,8 +162,6 @@ postAnnuaire corpusName title ns = do
-------------------------------------------------------------- --------------------------------------------------------------
-- Tests -- Tests
-------------------------------------------------------------- --------------------------------------------------------------
get' :: PWD -> IO [Node Value] get' :: PWD -> IO [Node Value]
get' = runCmd' . get get' = runCmd' . get
......
...@@ -70,23 +70,22 @@ $(deriveJSON (unPrefix "status_") ''Status) ...@@ -70,23 +70,22 @@ $(deriveJSON (unPrefix "status_") ''Status)
instance Arbitrary Status where instance Arbitrary Status where
arbitrary = Status <$> arbitrary <*> arbitrary <*> arbitrary arbitrary = Status <$> arbitrary <*> arbitrary <*> arbitrary
------------------------------------------------------------------------ ------------------------------------------------------------------------
data StatusV3 = StatusV3 { statusV3_error :: Maybe Text data StatusV3 = StatusV3 { statusV3_error :: Maybe Text
, statusV3_action :: Maybe Text , statusV3_action :: Maybe Text
} deriving (Show, Generic) } deriving (Show, Generic)
$(deriveJSON (unPrefix "statusV3_") ''StatusV3) $(deriveJSON (unPrefix "statusV3_") ''StatusV3)
------------------------------------------------------------------------ ------------------------------------------------------------------------
------------------------------------------------------------------------ ------------------------------------------------------------------------
data HyperdataDocumentV3 = HyperdataDocumentV3 { hyperdataDocumentV3_publication_day :: Maybe Int data HyperdataDocumentV3 = HyperdataDocumentV3 { hyperdataDocumentV3_publication_day :: Maybe Int
, hyperdataDocumentV3_language_iso2 :: Maybe Text , hyperdataDocumentV3_language_iso2 :: Maybe Text
, hyperdataDocumentV3_publication_second :: Maybe Int
, hyperdataDocumentV3_publication_minute :: Maybe Int , hyperdataDocumentV3_publication_minute :: Maybe Int
, hyperdataDocumentV3_error :: Maybe Text
, hyperdataDocumentV3_publication_month :: Maybe Int , hyperdataDocumentV3_publication_month :: Maybe Int
, hyperdataDocumentV3_publication_hour :: Maybe Int
, hyperdataDocumentV3_error :: Maybe Text
, hyperdataDocumentV3_language_iso3 :: Maybe Text , hyperdataDocumentV3_language_iso3 :: Maybe Text
, hyperdataDocumentV3_publication_second :: Maybe Int
, hyperdataDocumentV3_authors :: Maybe Text , hyperdataDocumentV3_authors :: Maybe Text
, hyperdataDocumentV3_publication_year :: Maybe Int , hyperdataDocumentV3_publication_year :: Maybe Int
, hyperdataDocumentV3_publication_date :: Maybe Text , hyperdataDocumentV3_publication_date :: Maybe Text
...@@ -96,7 +95,6 @@ data HyperdataDocumentV3 = HyperdataDocumentV3 { hyperdataDocumentV3_publication ...@@ -96,7 +95,6 @@ data HyperdataDocumentV3 = HyperdataDocumentV3 { hyperdataDocumentV3_publication
, hyperdataDocumentV3_source :: Maybe Text , hyperdataDocumentV3_source :: Maybe Text
, hyperdataDocumentV3_abstract :: Maybe Text , hyperdataDocumentV3_abstract :: Maybe Text
, hyperdataDocumentV3_title :: Maybe Text , hyperdataDocumentV3_title :: Maybe Text
, hyperdataDocumentV3_publication_hour :: Maybe Int
} deriving (Show, Generic) } deriving (Show, Generic)
$(deriveJSON (unPrefix "hyperdataDocumentV3_") ''HyperdataDocumentV3) $(deriveJSON (unPrefix "hyperdataDocumentV3_") ''HyperdataDocumentV3)
......
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