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
175
Issues
175
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
3f209cdd
Commit
3f209cdd
authored
Jul 29, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] backend route.
parent
143840d4
Pipeline
#530
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
46 deletions
+3
-46
Node.hs
src/Gargantext/API/Node.hs
+3
-46
No files found.
src/Gargantext/API/Node.hs
View file @
3f209cdd
...
@@ -7,7 +7,6 @@ Maintainer : team@gargantext.org
...
@@ -7,7 +7,6 @@ Maintainer : team@gargantext.org
Stability : experimental
Stability : experimental
Portability : POSIX
Portability : POSIX
-- TODO-ACCESS: CanGetNode
-- TODO-ACCESS: CanGetNode
-- TODO-EVENTS: No events as this is a read only query.
-- TODO-EVENTS: No events as this is a read only query.
Node API
Node API
...
@@ -19,7 +18,6 @@ Node API
...
@@ -19,7 +18,6 @@ Node API
-- TODO-EVENTS: DeletedNodes [NodeId]
-- TODO-EVENTS: DeletedNodes [NodeId]
-- {"tag": "DeletedNodes", "nodes": [Int*]}
-- {"tag": "DeletedNodes", "nodes": [Int*]}
-}
-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
...
@@ -51,20 +49,18 @@ import GHC.Generics (Generic)
...
@@ -51,20 +49,18 @@ import GHC.Generics (Generic)
import
Gargantext.API.Metrics
import
Gargantext.API.Metrics
import
Gargantext.API.Ngrams
(
TabType
(
..
),
TableNgramsApi
,
apiNgramsTableCorpus
,
QueryParamR
,
TODO
)
import
Gargantext.API.Ngrams
(
TabType
(
..
),
TableNgramsApi
,
apiNgramsTableCorpus
,
QueryParamR
,
TODO
)
import
Gargantext.API.Ngrams.NTree
(
MyTree
)
import
Gargantext.API.Ngrams.NTree
(
MyTree
)
import
Gargantext.API.Search
(
SearchDocsAPI
,
searchDocs
,
SearchQuery
(
..
))
import
Gargantext.API.Search
(
SearchDocsAPI
,
searchDocs
)
import
Gargantext.API.Table
import
Gargantext.API.Types
import
Gargantext.API.Types
import
Gargantext.Core.Types
(
Offset
,
Limit
)
import
Gargantext.Core.Types.Main
(
Tree
,
NodeTree
,
ListType
)
import
Gargantext.Core.Types.Main
(
Tree
,
NodeTree
,
ListType
)
import
Gargantext.Database.Config
(
nodeTypeId
)
import
Gargantext.Database.Config
(
nodeTypeId
)
import
Gargantext.Database.Facet
(
FacetDoc
,
runViewDocuments
,
OrderBy
(
..
),
runViewAuthorsDoc
)
import
Gargantext.Database.Facet
(
FacetDoc
,
OrderBy
(
..
)
)
import
Gargantext.Database.Node.Children
(
getChildren
)
import
Gargantext.Database.Node.Children
(
getChildren
)
import
Gargantext.Database.Schema.Node
(
getNodesWithParentId
,
getNode
,
getNode'
,
deleteNode
,
deleteNodes
,
mkNodeWithParent
,
JSONB
,
HasNodeError
(
..
))
import
Gargantext.Database.Schema.Node
(
getNodesWithParentId
,
getNode
,
getNode'
,
deleteNode
,
deleteNodes
,
mkNodeWithParent
,
JSONB
,
HasNodeError
(
..
))
import
Gargantext.Database.Schema.NodeNode
(
nodeNodesCategory
)
import
Gargantext.Database.Schema.NodeNode
(
nodeNodesCategory
)
import
Gargantext.Database.Tree
(
treeDB
)
import
Gargantext.Database.Tree
(
treeDB
)
import
Gargantext.Database.Types.Node
import
Gargantext.Database.Types.Node
import
Gargantext.Database.TextSearch
import
Gargantext.Database.Utils
-- (Cmd, CmdM)
import
Gargantext.Database.Utils
-- (Cmd, CmdM)
import
Gargantext.Database.Learn
(
FavOrTrash
(
..
),
moreLike
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.Prelude.Utils
(
hash
)
import
Gargantext.Prelude.Utils
(
hash
)
import
Gargantext.Viz.Chart
import
Gargantext.Viz.Chart
...
@@ -236,16 +232,7 @@ catApi = putCat
...
@@ -236,16 +232,7 @@ catApi = putCat
putCat
::
CorpusId
->
NodesToCategory
->
Cmd
err
[
Int
]
putCat
::
CorpusId
->
NodesToCategory
->
Cmd
err
[
Int
]
putCat
cId
cs'
=
nodeNodesCategory
$
map
(
\
n
->
(
cId
,
n
,
ntc_category
cs'
))
(
ntc_nodesId
cs'
)
putCat
cId
cs'
=
nodeNodesCategory
$
map
(
\
n
->
(
cId
,
n
,
ntc_category
cs'
))
(
ntc_nodesId
cs'
)
------------------------------------------------------------------------
------------------------------------------------------------------------
type
TableApi
=
Summary
" Table API"
:>
ReqBody
'[
J
SON
]
SearchQuery
:>
QueryParam
"view"
TabType
:>
QueryParam
"offset"
Int
:>
QueryParam
"limit"
Int
:>
QueryParam
"order"
OrderBy
:>
Post
'[
J
SON
]
[
FacetDoc
]
-- TODO adapt FacetDoc -> ListDoc (and add type of document as column)
-- TODO adapt FacetDoc -> ListDoc (and add type of document as column)
type
PairingApi
=
Summary
" Pairing API"
type
PairingApi
=
Summary
" Pairing API"
:>
QueryParam
"view"
TabType
:>
QueryParam
"view"
TabType
...
@@ -324,36 +311,6 @@ treeAPI = treeDB
...
@@ -324,36 +311,6 @@ treeAPI = treeDB
rename
::
NodeId
->
RenameNode
->
Cmd
err
[
Int
]
rename
::
NodeId
->
RenameNode
->
Cmd
err
[
Int
]
rename
nId
(
RenameNode
name'
)
=
U
.
update
(
U
.
Rename
nId
name'
)
rename
nId
(
RenameNode
name'
)
=
U
.
update
(
U
.
Rename
nId
name'
)
tableApi
::
NodeId
->
SearchQuery
->
Maybe
TabType
->
Maybe
Offset
->
Maybe
Limit
->
Maybe
OrderBy
->
Cmd
err
[
FacetDoc
]
tableApi
cId
(
SearchQuery
[]
)
ft
o
l
order
=
getTable
cId
ft
o
l
order
tableApi
cId
(
SearchQuery
q
)
ft
o
l
order
=
case
ft
of
Just
Docs
->
searchInCorpus
cId
q
o
l
order
Just
Trash
->
panic
"TODO search in Trash"
-- TODO searchInCorpus cId q o l order
_
->
panic
"not implemented: search in Fav/Trash/*"
getTable
::
NodeId
->
Maybe
TabType
->
Maybe
Offset
->
Maybe
Limit
->
Maybe
OrderBy
->
Cmd
err
[
FacetDoc
]
getTable
cId
ft
o
l
order
=
case
ft
of
(
Just
Docs
)
->
runViewDocuments
cId
False
o
l
order
(
Just
Trash
)
->
runViewDocuments
cId
True
o
l
order
(
Just
MoreFav
)
->
moreLike
cId
o
l
order
IsFav
(
Just
MoreTrash
)
->
moreLike
cId
o
l
order
IsTrash
_
->
panic
"not implemented"
getPairing
::
ContactId
->
Maybe
TabType
->
Maybe
Offset
->
Maybe
Limit
->
Maybe
OrderBy
->
Cmd
err
[
FacetDoc
]
getPairing
cId
ft
o
l
order
=
case
ft
of
(
Just
Docs
)
->
runViewAuthorsDoc
cId
False
o
l
order
(
Just
Trash
)
->
runViewAuthorsDoc
cId
True
o
l
order
_
->
panic
"not implemented"
postNode
::
HasNodeError
err
=>
UserId
->
NodeId
->
PostNode
->
Cmd
err
[
NodeId
]
postNode
::
HasNodeError
err
=>
UserId
->
NodeId
->
PostNode
->
Cmd
err
[
NodeId
]
postNode
uId
pId
(
PostNode
nodeName
nt
)
=
mkNodeWithParent
nt
(
Just
pId
)
uId
nodeName
postNode
uId
pId
(
PostNode
nodeName
nt
)
=
mkNodeWithParent
nt
(
Just
pId
)
uId
nodeName
...
...
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