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
153
Issues
153
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
haskell-gargantext
Commits
722bd504
Commit
722bd504
authored
Feb 18, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEBUG] AddDocument
parent
adee098c
Pipeline
#2501
passed with stage
in 55 minutes and 1 second
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
DocumentUpload.hs
src/Gargantext/API/Node/DocumentUpload.hs
+15
-4
No files found.
src/Gargantext/API/Node/DocumentUpload.hs
View file @
722bd504
...
...
@@ -69,21 +69,31 @@ api :: UserId -> NodeId -> GargServer API
api
uId
nId
=
serveJobsAPI
$
JobFunction
(
\
q
log'
->
do
documentUpload
uId
nId
q
(
liftBase
.
log'
)
documentUpload
Async
uId
nId
q
(
liftBase
.
log'
)
)
documentUpload
::
(
FlowCmdM
env
err
m
)
documentUpload
Async
::
(
FlowCmdM
env
err
m
)
=>
UserId
->
NodeId
->
DocumentUpload
->
(
JobLog
->
m
()
)
->
m
JobLog
documentUpload
_uId
nId
doc
logStatus
=
do
documentUpload
Async
_uId
nId
doc
logStatus
=
do
let
jl
=
JobLog
{
_scst_succeeded
=
Just
0
,
_scst_failed
=
Just
0
,
_scst_remaining
=
Just
1
,
_scst_events
=
Just
[]
}
logStatus
jl
_
<-
documentUpload
nId
doc
pure
$
jobLogSuccess
jl
documentUpload
::
(
FlowCmdM
env
err
m
)
=>
NodeId
->
DocumentUpload
->
m
[
DocId
]
documentUpload
nId
doc
=
do
mcId
<-
getClosestParentIdByType'
nId
NodeCorpus
let
cId
=
case
mcId
of
Just
c
->
c
...
...
@@ -116,5 +126,6 @@ documentUpload _uId nId doc logStatus = do
docIds
<-
insertMasterDocs
(
Nothing
::
Maybe
HyperdataCorpus
)
(
Multi
EN
)
[
hd
]
_
<-
Doc
.
add
cId
docIds
pure
docIds
pure
$
jobLogSuccess
jl
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