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
158
Issues
158
List
Board
Labels
Milestones
Merge Requests
10
Merge Requests
10
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
689ace0f
Commit
689ace0f
authored
Nov 08, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API][NGRAMS] NgramsElement without ids.
parent
6651d0d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+5
-6
Node.hs
src/Gargantext/API/Node.hs
+2
-2
Main.hs
src/Gargantext/Core/Types/Main.hs
+1
-1
No files found.
src/Gargantext/API/Ngrams.hs
View file @
689ace0f
...
...
@@ -84,11 +84,10 @@ instance Arbitrary TabType
------------------------------------------------------------------------
data
NgramsElement
=
NgramsElement
{
_ne_id
::
Int
,
_ne_ngrams
::
Text
NgramsElement
{
_ne_ngrams
::
Text
,
_ne_list
::
ListType
}
deriving
(
Ord
,
Eq
)
deriving
(
Ord
,
Eq
,
Show
)
$
(
deriveJSON
(
unPrefix
"_ne_"
)
''
N
gramsElement
)
...
...
@@ -105,8 +104,8 @@ $(deriveJSON (unPrefix "_") ''NgramsTable)
data
NgramsPatch
=
NgramsPatch
{
_np_list_types
::
ListType
-- TODO Map UserId ListType
,
_np_add_children
::
Set
Ngrams
Id
,
_np_rem_children
::
Set
Ngrams
Id
,
_np_add_children
::
Set
Ngrams
Element
,
_np_rem_children
::
Set
Ngrams
Element
}
deriving
(
Ord
,
Eq
,
Show
,
Generic
)
$
(
deriveJSON
(
unPrefix
"_np_"
)
''
N
gramsPatch
)
...
...
@@ -119,7 +118,7 @@ instance Arbitrary NgramsPatch where
--
data
NgramsIdPatch
=
NgramsIdPatch
{
_nip_ngramsId
::
Ngrams
Id
NgramsIdPatch
{
_nip_ngramsId
::
Ngrams
Element
,
_nip_ngramsPatch
::
NgramsPatch
}
deriving
(
Ord
,
Eq
,
Show
,
Generic
)
...
...
src/Gargantext/API/Node.hs
View file @
689ace0f
...
...
@@ -48,7 +48,7 @@ import Database.PostgreSQL.Simple (Connection)
import
GHC.Generics
(
Generic
)
import
Servant
import
Gargantext.API.Ngrams
(
TabType
(
..
),
TableNgramsApi
,
TableNgramsApiGet
,
tableNgramsPatch
,
getTableNgramsPatch
,
NgramsIdPatchsFeed
,
NgramsIdPatchsBack
)
import
Gargantext.API.Ngrams
(
TabType
(
..
),
TableNgramsApi
,
TableNgramsApiGet
,
tableNgramsPatch
,
getTableNgramsPatch
,
NgramsIdPatchsFeed
,
NgramsIdPatchsBack
,
NgramsTable
)
import
Gargantext.Prelude
import
Gargantext.Database.Types.Node
import
Gargantext.Database.Node
(
runCmd
...
...
@@ -289,7 +289,7 @@ getNodesWith' conn id p nodeType offset limit = liftIO (getNodesWith conn id p
tableNgramsPatch'
::
Connection
->
CorpusId
->
Maybe
ListId
->
NgramsIdPatchsFeed
->
Handler
NgramsIdPatchsBack
tableNgramsPatch'
c
cId
mL
ns
=
liftIO
$
tableNgramsPatch
c
cId
mL
ns
getTableNgramsPatch'
::
Connection
->
CorpusId
->
Maybe
TabType
->
Maybe
ListId
->
Handler
Ngrams
IdPatchsBack
getTableNgramsPatch'
::
Connection
->
CorpusId
->
Maybe
TabType
->
Maybe
ListId
->
Handler
Ngrams
Table
getTableNgramsPatch'
c
cId
nType
mL
=
liftIO
$
getTableNgramsPatch
c
cId
nType
mL
query
::
Text
->
Handler
Text
...
...
src/Gargantext/Core/Types/Main.hs
View file @
689ace0f
...
...
@@ -139,7 +139,7 @@ instance ToJSON a => ToJSON (Tree a) where
toJSON
(
TreeN
node
nodes
)
=
object
[
"node"
A
..=
toJSON
node
,
"children"
A
..=
toJSON
nodes
]
instance
FromJSON
(
Tree
NodeTree
)
instance
FromJSON
a
=>
FromJSON
(
Tree
a
)
instance
ToSchema
NodeTree
instance
ToSchema
(
Tree
NodeTree
)
...
...
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