Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
istex
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
gargantext
crawlers
istex
Commits
6821f416
Commit
6821f416
authored
Jun 14, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] IsTex API with Maybe parameters
parent
b12e7618
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
ISTEX.hs
src/ISTEX.hs
+2
-2
Client.hs
src/ISTEX/Client.hs
+9
-8
No files found.
src/ISTEX.hs
View file @
6821f416
...
...
@@ -48,7 +48,7 @@ getMetadataScroll q scroll scrollId page = do
case
eRes
of
Left
err
->
pure
$
Left
err
Right
res
@
(
ScrollResponse
{
..
})
->
do
eDocs
<-
getMetadataScroll
q
scroll
(
Just
_scroll_scrollId
)
(
page
+
1
)
eDocs
<-
getMetadataScroll
q
scroll
_scroll_scrollId
(
page
+
1
)
case
eDocs
of
Left
err
->
pure
$
Left
err
Right
docs
->
pure
$
Right
$
_scroll_documents
<>
docs
...
...
@@ -68,7 +68,7 @@ getMetadataScrollProgress q scroll scrollId progress errorHandler = do
,
_scroll_nextScrollURI
,
_scroll_scrollId
})
->
do
progress
res
getMetadataScrollProgress
q
scroll
(
Just
_scroll_scrollId
)
progress
errorHandler
getMetadataScrollProgress
q
scroll
_scroll_scrollId
progress
errorHandler
type
Query
=
Text
...
...
src/ISTEX/Client.hs
View file @
6821f416
...
...
@@ -91,17 +91,18 @@ instance Monoid Documents where
data
ScrollResponse
=
ScrollResponse
{
_scroll_documents
::
Documents
,
_scroll_noMoreScrollResults
::
Bool
,
_scroll_nextScrollURI
::
T
.
Text
,
_scroll_scrollId
::
T
.
Text
}
,
_scroll_noMoreScrollResults
::
Maybe
Bool
,
_scroll_nextScrollURI
::
Maybe
T
.
Text
,
_scroll_scrollId
::
Maybe
T
.
Text
}
L
.
makeLenses
''
S
crollResponse
instance
FromJSON
ScrollResponse
where
parseJSON
(
Object
o
)
=
do
_documents_total
<-
o
.:
"total"
_documents_hits
<-
o
.:
"hits"
_scroll_noMoreScrollResults
<-
o
.:
"noMoreScrollResults"
_scroll_nextScrollURI
<-
o
.:
"nextScrollURI"
_scroll_scrollId
<-
o
.:
"scrollId"
_documents_total
<-
o
.:
"total"
_documents_hits
<-
o
.:
"hits"
_scroll_noMoreScrollResults
<-
o
.:
?
"noMoreScrollResults"
_scroll_nextScrollURI
<-
o
.:?
"nextScrollURI"
_scroll_scrollId
<-
o
.:?
"scrollId"
pure
$
ScrollResponse
{
_scroll_documents
=
Documents
{
..
}
,
..
}
...
...
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