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
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
Christian Merten
haskell-gargantext
Commits
dc98f9f5
Commit
dc98f9f5
authored
Oct 22, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API] question about Servant route refactoring.
parent
38449989
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
Node.hs
src/Gargantext/API/Node.hs
+15
-12
No files found.
src/Gargantext/API/Node.hs
View file @
dc98f9f5
...
...
@@ -103,9 +103,9 @@ instance Arbitrary PostNode where
arbitrary
=
elements
[
PostNode
"Node test"
NodeCorpus
]
------------------------------------------------------------------------
type
DocsApi
=
"documents"
:>
Summary
"Docs api
"
:>
ReqBody
'[
J
SON
]
Documents
:>
Delete
'[
J
SON
]
[
Int
]
type
DocsApi
=
Summary
"Move to trash
"
:>
ReqBody
'[
J
SON
]
Documents
:>
Delete
'[
J
SON
]
[
Int
]
data
Documents
=
Documents
{
documents
::
[
NodeId
]}
deriving
(
Generic
)
...
...
@@ -119,12 +119,12 @@ delDocs c cId ds = liftIO $ nodesToTrash c
$
map
(
\
n
->
(
cId
,
n
,
True
))
$
documents
ds
------------------------------------------------------------------------
type
FavApi
=
"favorites"
:>
Summary
"Modify statut
"
:>
ReqBody
'[
J
SON
]
Favorites
:>
Put
'[
J
SON
]
[
Int
]
:<|>
Summary
"Delete
"
:>
ReqBody
'[
J
SON
]
Favorites
:>
Delete
'[
J
SON
]
[
Int
]
type
FavApi
=
Summary
"Label as Favorites
"
:>
ReqBody
'[
J
SON
]
Favorites
:>
Put
'[
J
SON
]
[
Int
]
:<|>
Summary
"Unlabel as Favorites
"
:>
ReqBody
'[
J
SON
]
Favorites
:>
Delete
'[
J
SON
]
[
Int
]
data
Favorites
=
Favorites
{
favorites
::
[
NodeId
]}
deriving
(
Generic
)
...
...
@@ -161,6 +161,10 @@ type NodeAPI a = Get '[JSON] (Node a)
:>
QueryParam
"limit"
Int
:>
Get
'[
J
SON
]
[
Node
a
]
:<|>
Summary
" Tabs"
:>
FacetDocAPI
-- How TODO ?
-- :<|> "favorites" :> Summary " Favorites" :> FavApi
-- :<|> "documents" :> Summary " Documents" :> DocsApi
-- TODO: make the NodeId type indexed by `a`, then we no longer need the proxy.
...
...
@@ -215,8 +219,8 @@ type FacetDocAPI = "table"
:>
QueryParam
"from"
UTCTime
:>
QueryParam
"to"
UTCTime
:>
Get
'[
J
SON
]
[
FacetChart
]
:<|>
Summary
" Favorites"
:>
FavApi
:<|>
Summary
" Documents"
:>
DocsApi
:<|>
"favorites"
:>
Summary
" Favorites"
:>
FavApi
:<|>
"documents"
:>
Summary
" Documents"
:>
DocsApi
-- Depending on the Type of the Node, we could post
-- New documents for a corpus
...
...
@@ -234,7 +238,6 @@ roots conn = liftIO (putStrLn ( "/user" :: Text) >> getNodesWithParentId 0 Nothi
:<|>
pure
(
panic
"not implemented yet"
)
-- TODO
:<|>
pure
(
panic
"not implemented yet"
)
-- TODO
------------------------------------------------------------------------
type
GraphAPI
=
Get
'[
J
SON
]
Graph
graphAPI
::
Connection
->
NodeId
->
Server
GraphAPI
...
...
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