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
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
Christian Merten
haskell-gargantext
Commits
0627535a
Commit
0627535a
authored
Mar 04, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[List] filename for content-disposition
parent
c0fde235
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
List.hs
src/Gargantext/API/Ngrams/List.hs
+5
-5
No files found.
src/Gargantext/API/Ngrams/List.hs
View file @
0627535a
...
@@ -23,7 +23,7 @@ Portability : POSIX
...
@@ -23,7 +23,7 @@ Portability : POSIX
module
Gargantext.API.Ngrams.List
module
Gargantext.API.Ngrams.List
where
where
import
Data.Text
(
Text
)
import
Data.Text
(
Text
,
concat
,
pack
)
import
Data.Aeson
import
Data.Aeson
import
Data.List
(
zip
)
import
Data.List
(
zip
)
import
Data.Map
(
Map
,
toList
,
fromList
)
import
Data.Map
(
Map
,
toList
,
fromList
)
...
@@ -45,12 +45,11 @@ instance Accept HTML where
...
@@ -45,12 +45,11 @@ instance Accept HTML where
instance
ToJSON
a
=>
MimeRender
HTML
a
where
instance
ToJSON
a
=>
MimeRender
HTML
a
where
mimeRender
_
=
encode
mimeRender
_
=
encode
type
API
=
Get
'[
J
SON
]
NgramsList
type
API
=
ReqBody
'[
J
SON
]
NgramsList
:>
Put
'[
J
SON
]
Bool
:<|>
ReqBody
'[
J
SON
]
NgramsList
:>
Put
'[
J
SON
]
Bool
:<|>
Get
'[
H
TML
]
(
Headers
'[
H
eader
"Content-Disposition"
Text
]
NgramsList
)
:<|>
Get
'[
H
TML
]
(
Headers
'[
H
eader
"Content-Disposition"
Text
]
NgramsList
)
api
::
ListId
->
GargServer
API
api
::
ListId
->
GargServer
API
api
l
=
get
l
:<|>
put
l
:<|>
getHtml
l
api
l
=
put
l
:<|>
getHtml
l
get
::
RepoCmdM
env
err
m
get
::
RepoCmdM
env
err
m
=>
ListId
->
m
NgramsList
=>
ListId
->
m
NgramsList
...
@@ -62,7 +61,8 @@ getHtml :: RepoCmdM env err m
...
@@ -62,7 +61,8 @@ getHtml :: RepoCmdM env err m
=>
ListId
->
m
(
Headers
'[
H
eader
"Content-Disposition"
Text
]
NgramsList
)
=>
ListId
->
m
(
Headers
'[
H
eader
"Content-Disposition"
Text
]
NgramsList
)
getHtml
lId
=
do
getHtml
lId
=
do
lst
<-
get
lId
lst
<-
get
lId
return
$
addHeader
"attachment"
lst
let
(
NodeId
id
)
=
lId
return
$
addHeader
(
concat
[
"attachment; filename=list-"
,
pack
$
show
id
,
".json"
])
lst
-- TODO : purge list
-- TODO : purge list
...
...
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