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
e58d0f2e
Commit
e58d0f2e
authored
Jun 04, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] API new corpus files_id as parameters.
parent
e6b501f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
New.hs
src/Gargantext/API/Corpus/New.hs
+5
-2
No files found.
src/Gargantext/API/Corpus/New.hs
View file @
e58d0f2e
...
...
@@ -33,6 +33,7 @@ import Gargantext.Core.Utils.Prefix (unPrefix)
import
Gargantext.Database.Flow
(
flowCorpusSearchInDatabase
)
import
Gargantext.Database.Types.Node
(
CorpusId
)
import
Gargantext.Prelude
import
Gargantext.Prelude.Utils
(
hash
)
import
Servant
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
...
...
@@ -40,6 +41,7 @@ import Gargantext.Database.Flow (FlowCmdM)
data
Query
=
Query
{
query_query
::
Text
,
query_corpus_id
::
Int
,
query_files_id
::
[
Text
]
}
deriving
(
Eq
,
Show
,
Generic
)
...
...
@@ -47,9 +49,10 @@ deriveJSON (unPrefix "query_") ''Query
instance
Arbitrary
Query
where
arbitrary
=
elements
[
Query
q
n
arbitrary
=
elements
[
Query
q
n
fs
|
q
<-
[
"a"
,
"b"
]
,
n
<-
[
0
..
10
]
,
fs
<-
map
(
map
hash
)
[[
"a"
,
"b"
],
[
"c"
,
"d"
]]
]
instance
ToSchema
Query
...
...
@@ -61,6 +64,6 @@ type Api = Summary "New Corpus endpoint"
api
::
FlowCmdM
env
err
m
=>
Query
->
m
CorpusId
api
(
Query
q
_
)
=
do
api
(
Query
q
_
_
)
=
do
cId
<-
flowCorpusSearchInDatabase
"user1"
EN
q
pure
cId
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