Commit b77b51bb authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX][Document] decodeJson.

parent cb87d66d
module Gargantext.Pages.Corpus.Document where
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject, (.?), (:=), (~>))
import Data.Argonaut (class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject, (.?), (.??), (:=), (~>))
import Data.Generic.Rep (class Generic)
import Data.Lens (Lens', Prism', lens, prism, (?~))
import Data.Generic.Rep.Show (genericShow)
......@@ -177,7 +177,7 @@ instance decodeDocumentV3 :: DecodeJson DocumentV3
where
decodeJson json = do
obj <- decodeJson json
abstract <- obj .? "abstract"
abstract <- obj .?? "abstract"
authors <- obj .? "authors"
--error <- obj .? "error"
language_iso2 <- obj .? "language_iso2"
......@@ -217,22 +217,22 @@ instance decodeDocument :: DecodeJson Document
where
decodeJson json = do
obj <- decodeJson json
abstract <- obj .? "abstract"
authors <- obj .? "authors"
bdd <- obj .? "bdd"
doi <- obj .? "doi"
language_iso2 <- obj .? "language_iso2"
-- page <- obj .? "page"
publication_date <- obj .? "publication_date"
--publication_second <- obj .? "publication_second"
--publication_minute <- obj .? "publication_minute"
--publication_hour <- obj .? "publication_hour"
publication_day <- obj .? "publication_day"
publication_month <- obj .? "publication_month"
publication_year <- obj .? "publication_year"
source <- obj .? "source"
title <- obj .? "title"
uniqId <- obj .? "uniqId"
abstract <- obj .?? "abstract"
authors <- obj .?? "authors"
bdd <- obj .?? "bdd"
doi <- obj .?? "doi"
language_iso2 <- obj .?? "language_iso2"
-- page <- obj .?? "page"
publication_date <- obj .?? "publication_date"
--publication_second <- obj .?? "publication_second"
--publication_minute <- obj .?? "publication_minute"
--publication_hour <- obj .?? "publication_hour"
publication_day <- obj .?? "publication_day"
publication_month <- obj .?? "publication_month"
publication_year <- obj .?? "publication_year"
source <- obj .?? "source"
title <- obj .?? "title"
uniqId <- obj .?? "uniqId"
--url <- obj .? "url"
--text <- obj .? "text"
pure $ Document { abstract
......
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