Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-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
Przemyslaw Kaminski
haskell-gargantext
Commits
62d9bdc6
Commit
62d9bdc6
authored
Feb 26, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Tree root design fun.
parent
76268fc5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
API.hs
src/Gargantext/API.hs
+4
-4
Node.hs
src/Gargantext/API/Node.hs
+2
-2
Node.hs
src/Gargantext/Database/Schema/Node.hs
+6
-2
No files found.
src/Gargantext/API.hs
View file @
62d9bdc6
...
...
@@ -367,14 +367,14 @@ serverPrivateGargAPI _ = throwAll' (_ServerError # err401)
-- TODO-SECURITY admin only: withAdmin
-- Question: How do we mark admins?
serverGargAdminAPI
::
NodeId
->
GargServer
GargAdminAPI
serverGargAdminAPI
n
=
roots
n
:<|>
nodesAPI
serverGargAdminAPI
::
GargServer
GargAdminAPI
serverGargAdminAPI
=
roots
:<|>
nodesAPI
serverPrivateGargAPI'
::
AuthenticatedUser
->
GargServer
GargPrivateAPI'
serverPrivateGargAPI'
(
AuthenticatedUser
(
NodeId
uid
))
=
serverGargAdminAPI
(
NodeId
0
)
=
serverGargAdminAPI
:<|>
nodeAPI
(
Proxy
::
Proxy
HyperdataAny
)
uid
:<|>
nodeAPI
(
Proxy
::
Proxy
HyperdataCorpus
)
uid
:<|>
nodeNodeAPI
(
Proxy
::
Proxy
HyperdataAny
)
uid
...
...
src/Gargantext/API/Node.hs
View file @
62d9bdc6
...
...
@@ -97,8 +97,8 @@ type Roots = Get '[JSON] [NodeUser]
:<|>
Put
'[
J
SON
]
Int
-- TODO
-- | TODO: access by admin only
roots
::
NodeId
->
GargServer
Roots
roots
n
=
getNodesWithParentId
n
roots
::
GargServer
Roots
roots
=
getNodesWithParentId
Nothing
:<|>
pure
(
panic
"not implemented yet"
)
-- TODO use patch map to update what we need
-------------------------------------------------------------------
...
...
src/Gargantext/Database/Schema/Node.hs
View file @
62d9bdc6
...
...
@@ -334,9 +334,13 @@ getNodesWith parentId _ nodeType maybeOffset maybeLimit =
-- TODO: Why is the second parameter ignored?
-- TODO: Why not use getNodesWith?
getNodesWithParentId
::
(
Hyperdata
a
,
QueryRunnerColumnDefault
PGJsonb
a
)
=>
NodeId
=>
Maybe
NodeId
->
Cmd
err
[
Node
a
]
getNodesWithParentId
n
=
runOpaQuery
$
selectNodesWithParentID
n
getNodesWithParentId
n
=
runOpaQuery
$
selectNodesWithParentID
n'
where
n'
=
case
n
of
Just
n''
->
n''
Nothing
->
0
------------------------------------------------------------------------
getDocumentsV3WithParentId
::
NodeId
->
Cmd
err
[
Node
HyperdataDocumentV3
]
...
...
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