Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-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
Grégoire Locqueville
purescript-gargantext
Commits
f5c6e917
Commit
f5c6e917
authored
Jun 05, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] API Search POST.
parent
38362aeb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
Types.purs
src/Gargantext/Components/Search/Types.purs
+6
-3
No files found.
src/Gargantext/Components/Search/Types.purs
View file @
f5c6e917
...
...
@@ -59,6 +59,7 @@ newtype SearchQuery = SearchQuery
{ query :: String
, databases :: Array Database
, corpus_id :: Maybe Int
, files_id :: Array String
, offset :: Maybe Int
, limit :: Maybe Int
, order :: Maybe SearchOrder }
...
...
@@ -70,6 +71,7 @@ defaultSearchQuery = SearchQuery
{ query: ""
, databases: allDatabases
, corpus_id: Nothing
, files_id : []
, offset: Nothing
, limit: Nothing
, order: Nothing }
...
...
@@ -83,7 +85,8 @@ instance searchQueryToQuery :: ToQuery SearchQuery where
[ QP.keyFromString k /\ Just (QP.valueFromString $ show v) ]
instance encodeJsonSearchQuery :: EncodeJson SearchQuery where
encodeJson (SearchQuery {query, corpus_id})
= "query" := query
~> "corpus_id" := fromMaybe 0 corpus_id
encodeJson (SearchQuery {query, corpus_id, files_id})
= "query" := query
~> "corpus_id" := fromMaybe 0 corpus_id
~> "files_id" := files_id
~> jsonEmptyObject
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