Commit 072a6f12 authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge remote-tracking branch 'origin/dev-fix-for-nolist-serialization' into dev

parents 6b0b6e02 4c728d8c
......@@ -147,9 +147,9 @@ actionWriteNodesDocumentsWithLangsCpt = here.component "actionWriteNodesDocument
type Params =
( id :: GT.ID
, selection :: ListSelection.Selection
, lang :: Lang
, paragraphs :: String
, selection :: ListSelection.Selection
)
documentsFromWriteNodesReq :: Session -> Record Params -> AffRESTError GT.AsyncTaskWithType
......
......@@ -9,7 +9,12 @@ import Data.Newtype (class Newtype)
import Gargantext.Types (ID, ListId, NodeType)
import Simple.JSON as JSON
data Selection = MyListsFirst | OtherListsFirst | SelectedLists (Array ListId) | NoList
data Selection =
MyListsFirst
| OtherListsFirst
| SelectedLists (Array ListId)
| NoList
derive instance Generic Selection _
instance Show Selection where
show MyListsFirst = "My lists first"
......@@ -25,7 +30,7 @@ instance Read Selection where
read _ = Nothing
instance JSON.WriteForeign Selection where
writeImpl MyListsFirst = JSON.writeImpl { "type": "MyListsFirst" }
writeImpl NoList = JSON.writeImpl { "type": "NoList" }
writeImpl NoList = JSON.writeImpl { "type": "NoList", "makeList": true }
writeImpl OtherListsFirst = JSON.writeImpl { "type": "OtherListsFirst" }
writeImpl (SelectedLists ids) = JSON.writeImpl { "type": "SelectedLists", value: ids }
......
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