Commit c6a6d9a4 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[list selection] define JSON serialization

parent e6c86289
Pipeline #1774 failed with stage
......@@ -21,6 +21,10 @@ instance Read Selection where
read "Other lists first" = Just OtherListsFirst
read "Selected lists" = Just $ SelectedLists []
read _ = Nothing
instance JSON.WriteForeign Selection where
writeImpl MyListsFirst = JSON.writeImpl { "type": "MyListsFirst" }
writeImpl OtherListsFirst = JSON.writeImpl { "type": "OtherListsFirst" }
writeImpl (SelectedLists ids) = JSON.writeImpl { "type": "SelectedLists", value: ids }
selectedListIds :: Selection -> Array ListId
selectedListIds (SelectedLists ids) = ids
......@@ -30,6 +34,9 @@ selectedListIds _ = []
----------------------
-- TODO Make a separate endpoint on the backend for fetching the whole
-- tree with NodeSimple results?
-- A simplified data structure (we don't want the full-blown (NodePoly
-- a), we care only about Corpus and NodeList node types, with id,
-- name and that's all).
......
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