Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
29651a33
Commit
29651a33
authored
Sep 10, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API] some fixes to enum types JSON serialization
parent
a10fbf1c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
Types.purs
...ext/Components/Forest/Tree/Node/Action/Contact/Types.purs
+13
-6
Public.purs
src/Gargantext/Components/Nodes/Home/Public.purs
+3
-4
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Contact/Types.purs
View file @
29651a33
module Gargantext.Components.Forest.Tree.Node.Action.Contact.Types where
import Data.Generic.Rep (class Generic)
import Data.Newtype (class Newtype)
import Data.Show.Generic (genericShow)
import Gargantext.Utils.SimpleJSON as GUSJ
import Simple.JSON as JSON
import Gargantext.Prelude (class Eq, class Show)
newtype AddContactParams =
AddContactParams { firstname :: String, lastname :: String }
data AddContactParams =
AddContactParams { firstname :: String, lastname :: String }
| AddContactParamsAdvanced { firstname :: String, lastname :: String }
derive instance Eq AddContactParams
derive instance Generic AddContactParams _
derive instance Newtype AddContactParams _
instance Show AddContactParams where show = genericShow
derive newtype instance JSON.ReadForeign AddContactParams
derive newtype instance JSON.WriteForeign AddContactParams
instance JSON.ReadForeign AddContactParams where readImpl = GUSJ.taggedSumRep
instance JSON.WriteForeign AddContactParams where
writeImpl (AddContactParams { firstname, lastname }) =
JSON.writeImpl { type: "AddContactParams"
, values: { firstname, lastname } }
writeImpl (AddContactParamsAdvanced { firstname, lastname }) =
JSON.writeImpl { type: "AddContactParamsAdvanced"
, values: { firstname, lastname } }
src/Gargantext/Components/Nodes/Home/Public.purs
View file @
29651a33
...
...
@@ -9,7 +9,6 @@ import Effect.Aff (Aff)
import Reactix as R
import Reactix.DOM.HTML as H
import Simple.JSON as JSON
import Simple.JSON.Generics as JSONG
import Gargantext.Config (publicBackend)
import Gargantext.Config.REST (get, RESTError)
...
...
@@ -17,6 +16,7 @@ import Gargantext.Ends (backendUrl)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Prelude
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.SimpleJSON as GUSJ
here :: R2.Here
here = R2.here "Gargantext.Components.Nodes.Home.Public"
...
...
@@ -35,9 +35,8 @@ data PublicData = PublicData
derive instance Eq PublicData
derive instance Generic PublicData _
instance JSON.ReadForeign PublicData where readImpl = JSONG.untaggedSumRep
instance Show PublicData where
show = genericShow
instance JSON.ReadForeign PublicData where readImpl = GUSJ.taggedSumRep
instance Show PublicData where show = genericShow
------------------------------------------------------------------------
type LoadData :: forall k. Row k
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment