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
148
Issues
148
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
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
4ccc7442
Commit
4ccc7442
authored
Apr 15, 2024
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/333-dev-no-html-when-downloading-empty-note' into dev
parents
5c29c257
7e8f5be1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
Frame.hs
src/Gargantext/Database/Admin/Types/Hyperdata/Frame.hs
+7
-3
No files found.
src/Gargantext/Database/Admin/Types/Hyperdata/Frame.hs
View file @
4ccc7442
...
...
@@ -14,11 +14,10 @@ Portability : POSIX
module
Gargantext.Database.Admin.Types.Hyperdata.Frame
where
import
Control.Lens
import
Data.ByteString.Lazy
(
toStrict
)
import
Data.Text
qualified
as
T
import
Gargantext.Database.Admin.Types.Hyperdata.Prelude
import
Gargantext.Prelude
hiding
(
toStrict
)
import
Gargantext.Prelude
(
(
$
),
Show
,
Applicative
(
pure
),
IO
,
(
.
),
(
&
),
decodeUtf8
)
import
Network.Wreq
qualified
as
Wreq
------------------------------------------------------------------------
...
...
@@ -62,7 +61,12 @@ instance ToSchema HyperdataFrame where
getHyperdataFrameContents
::
HyperdataFrame
->
IO
Text
getHyperdataFrameContents
(
HyperdataFrame
{
_hf_base
,
_hf_frame_id
})
=
do
let
path
=
T
.
concat
[
_hf_base
,
"/"
,
_hf_frame_id
,
"/download"
]
let
path
=
T
.
intercalate
"/"
[
_hf_base
,
_hf_frame_id
,
"download"
]
-- We need to issue a request to this frame, because it might not
-- have been fetched yet and in that case codimd returns some ugly
-- HTML
-- See issue https://gitlab.iscpif.fr/gargantext/haskell-gargantext/issues/333
_
<-
Wreq
.
headWith
Wreq
.
defaults
$
T
.
unpack
path
r
<-
Wreq
.
get
$
T
.
unpack
path
pure
$
decodeUtf8
$
toStrict
$
r
^.
Wreq
.
responseBody
...
...
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