Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
gargantext
haskell-gargantext
Commits
7e9419b0
Commit
7e9419b0
authored
Sep 08, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[share] fix JSON deserialization of ShareNodeParams
parent
2a4febfe
Pipeline
#1779
passed with stage
in 32 minutes and 40 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
Share.hs
src/Gargantext/API/Node/Share.hs
+3
-2
No files found.
src/Gargantext/API/Node/Share.hs
View file @
7e9419b0
...
@@ -30,6 +30,7 @@ import Gargantext.Database.Prelude
...
@@ -30,6 +30,7 @@ import Gargantext.Database.Prelude
import
Gargantext.Database.Query.Tree
(
findNodesWithType
)
import
Gargantext.Database.Query.Tree
(
findNodesWithType
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
(
..
))
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
(
..
))
import
Gargantext.Prelude
import
Gargantext.Prelude
import
qualified
Gargantext.Utils.Aeson
as
GUA
import
Servant
import
Servant
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
import
Test.QuickCheck.Arbitrary
...
@@ -42,9 +43,9 @@ data ShareNodeParams = ShareTeamParams { username :: Text }
...
@@ -42,9 +43,9 @@ data ShareNodeParams = ShareTeamParams { username :: Text }
------------------------------------------------------------------------
------------------------------------------------------------------------
-- TODO unPrefix "pn_" FromJSON, ToJSON, ToSchema, adapt frontend.
-- TODO unPrefix "pn_" FromJSON, ToJSON, ToSchema, adapt frontend.
instance
FromJSON
ShareNodeParams
where
instance
FromJSON
ShareNodeParams
where
parseJSON
=
genericParseJSON
(
defaultOptions
{
sumEncoding
=
ObjectWithSingleField
})
parseJSON
=
genericParseJSON
(
defaultOptions
{
sumEncoding
=
GUA
.
defaultTaggedObject
})
instance
ToJSON
ShareNodeParams
where
instance
ToJSON
ShareNodeParams
where
toJSON
=
genericToJSON
(
defaultOptions
{
sumEncoding
=
ObjectWithSingleField
})
toJSON
=
genericToJSON
(
defaultOptions
{
sumEncoding
=
GUA
.
defaultTaggedObject
})
instance
ToSchema
ShareNodeParams
instance
ToSchema
ShareNodeParams
instance
Arbitrary
ShareNodeParams
where
instance
Arbitrary
ShareNodeParams
where
arbitrary
=
elements
[
ShareTeamParams
"user1"
arbitrary
=
elements
[
ShareTeamParams
"user1"
...
...
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