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
1d2d97f9
Commit
1d2d97f9
authored
Jul 23, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[list] upload CSV endpoint works, but 400 error still thrown
Also, updated nix a bit.
parent
eaed01a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
16 deletions
+20
-16
pinned-21.05.nix
nix/pinned-21.05.nix
+1
-1
pkgs.nix
nix/pkgs.nix
+3
-3
List.hs
src/Gargantext/API/Ngrams/List.hs
+16
-12
No files found.
nix/pinned-21.05.nix
View file @
1d2d97f9
...
...
@@ -2,5 +2,5 @@ import (builtins.fetchGit {
name
=
"nixos-21.05"
;
url
=
"https://github.com/nixos/nixpkgs"
;
ref
=
"refs/heads/nixos-21.05"
;
rev
=
"
6613a30c5e3ee59753181512b4bedd4121569925
"
;
rev
=
"
7e9b0dff974c89e070da1ad85713ff3c20b0ca97
"
;
})
nix/pkgs.nix
View file @
1d2d97f9
...
...
@@ -22,12 +22,12 @@ rec {
zlib
blas
gfortran7
gfortran7
.
cc
.
lib
#
gfortran7.cc.lib
];
libPaths
=
pkgs
.
lib
.
makeLibraryPath
nonhsBuildInputs
;
shellHook
=
''
export LD_LIBRARY_PATH="
${
libPaths
}
"
export LIBRARY_PATH="
${
libPaths
}
"
export LD_LIBRARY_PATH="
${
pkgs
.
gfortran7
.
cc
.
lib
}
:
${
libPaths
}
:$LD_LIBRARY_PATH
"
export LIBRARY_PATH="
${
pkgs
.
gfortran7
.
cc
.
lib
}
:
${
libPaths
}
"
''
;
shell
=
pkgs
.
mkShell
{
name
=
"gargantext-shell"
;
...
...
src/Gargantext/API/Ngrams/List.hs
View file @
1d2d97f9
...
...
@@ -24,6 +24,16 @@ import Data.Set (Set)
import
Data.Swagger
(
ToSchema
,
declareNamedSchema
,
genericDeclareNamedSchema
)
import
Data.Text
(
Text
,
concat
,
pack
)
import
GHC.Generics
(
Generic
)
import
Network.HTTP.Media
((
//
),
(
/:
))
import
Servant
import
Servant.Job.Async
import
Servant.Job.Utils
(
jsonOptions
)
import
Web.FormUrlEncoded
(
FromForm
)
import
qualified
Data.HashMap.Strict
as
HashMap
import
qualified
Data.List
as
List
import
qualified
Data.Map
as
Map
import
qualified
Data.Text
as
Text
import
Gargantext.API.Admin.Orchestrator.Types
import
Gargantext.API.Ngrams
(
getNgramsTableMap
,
setListNgrams
)
import
Gargantext.API.Ngrams.Tools
(
getTermsWith
)
...
...
@@ -44,15 +54,6 @@ import Gargantext.Database.Schema.Ngrams
import
Gargantext.Database.Schema.Node
import
Gargantext.Database.Types
(
Indexed
(
..
))
import
Gargantext.Prelude
import
Network.HTTP.Media
((
//
),
(
/:
))
import
Servant
import
Servant.Job.Async
import
Servant.Job.Utils
(
jsonOptions
)
import
Web.FormUrlEncoded
(
FromForm
)
import
qualified
Data.HashMap.Strict
as
HashMap
import
qualified
Data.List
as
List
import
qualified
Data.Map
as
Map
import
qualified
Data.Text
as
Text
------------------------------------------------------------------------
type
API
=
Get
'[
J
SON
,
HTML
]
(
Headers
'[
H
eader
"Content-Disposition"
Text
]
NgramsList
)
...
...
@@ -184,7 +185,7 @@ type PostAPI = Summary "Update List"
postAsync
::
ListId
->
GargServer
PostAPI
postAsync
lId
=
serveJobsAPI
$
JobFunction
(
\
f
log'
->
postAsync'
lId
f
(
liftBase
.
log'
))
JobFunction
(
\
f
log'
->
postAsync'
lId
f
(
liftBase
.
log'
))
postAsync'
::
FlowCmdM
env
err
m
=>
ListId
...
...
@@ -208,6 +209,7 @@ postAsync' l (WithFile _ m _) logStatus = do
------------------------------------------------------------------------
type
CSVPostAPI
=
Summary
"Update List (legacy v3 CSV)"
:>
"csv"
:>
"add"
:>
"form"
:>
"async"
:>
AsyncJobs
JobLog
'[
F
ormUrlEncoded
]
WithFile
JobLog
...
...
@@ -215,7 +217,10 @@ type CSVPostAPI = Summary "Update List (legacy v3 CSV)"
csvPostAsync
::
ListId
->
GargServer
PostAPI
csvPostAsync
lId
=
serveJobsAPI
$
JobFunction
(
\
f
log'
->
csvPostAsync'
lId
f
(
liftBase
.
log'
))
JobFunction
$
\
f
@
(
WithFile
ft
_
n
)
log'
->
do
printDebug
"[csvPostAsync] filetype"
ft
printDebug
"[csvPostAsync] name"
n
csvPostAsync'
lId
f
(
liftBase
.
log'
)
csvPostAsync'
::
FlowCmdM
env
err
m
=>
ListId
...
...
@@ -223,7 +228,6 @@ csvPostAsync' :: FlowCmdM env err m
->
(
JobLog
->
m
()
)
->
m
JobLog
csvPostAsync'
l
(
WithFile
_
m
_
)
logStatus
=
do
logStatus
JobLog
{
_scst_succeeded
=
Just
0
,
_scst_failed
=
Just
0
,
_scst_remaining
=
Just
1
...
...
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