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

[FIX] Editor JSON filtered for Lists and Texts

parent dec4588c
...@@ -65,12 +65,15 @@ data FieldType = ...@@ -65,12 +65,15 @@ data FieldType =
, text :: MarkdownText , text :: MarkdownText
} }
isJSON :: FieldType -> Boolean
isJSON (JSON _) = true isJSON :: Field FieldType -> Boolean
isJSON _ = false isJSON (Field {typ}) = isJSON' typ
where
isJSON' (JSON _) = true
isJSON' _ = false
getCorpusInfo :: List.List (Field FieldType) -> CorpusInfo getCorpusInfo :: List.List (Field FieldType) -> CorpusInfo
getCorpusInfo as = case List.head as of getCorpusInfo as = case List.head (List.filter isJSON as) of
Just (Field {typ: JSON {authors, desc,query,title}}) -> CorpusInfo { title Just (Field {typ: JSON {authors, desc,query,title}}) -> CorpusInfo { title
, desc , desc
, query , query
......
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