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
160
Issues
160
List
Board
Labels
Milestones
Merge Requests
14
Merge Requests
14
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
0d383903
Commit
0d383903
authored
Jun 19, 2023
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Try the hotfix"
This reverts commit
22b14f56
.
parent
572e7fa2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
30 deletions
+4
-30
New.hs
src/Gargantext/API/Node/Corpus/New.hs
+3
-3
Types.hs
src/Gargantext/API/Node/Corpus/Types.hs
+1
-0
Node.hs
src/Gargantext/Database/Query/Table/Node.hs
+0
-27
No files found.
src/Gargantext/API/Node/Corpus/New.hs
View file @
0d383903
...
...
@@ -56,7 +56,7 @@ import Gargantext.Database.Action.User (getUserId)
import
Gargantext.Database.Admin.Types.Hyperdata
import
Gargantext.Database.Admin.Types.Node
(
CorpusId
,
NodeType
(
..
))
import
Gargantext.Database.Prelude
(
hasConfig
)
import
Gargantext.Database.Query.Table.Node
(
getNodeWith
,
updateCorpusPubmedAPIKey
)
import
Gargantext.Database.Query.Table.Node
(
getNodeWith
)
import
Gargantext.Database.Query.Table.Node.UpdateOpaleye
(
updateHyperdata
)
import
Gargantext.Database.Schema.Node
(
node_hyperdata
)
import
Gargantext.Prelude
...
...
@@ -208,10 +208,10 @@ addToCorpusWithQuery user cid (WithQuery { _wq_query = q
_
->
do
case
datafield
of
Just
(
External
(
Just
PubMed
)
)
->
do
Just
(
External
PubMed
)
->
do
_api_key
<-
view
$
hasConfig
.
gc_pubmed_api_key
printDebug
"[addToCorpusWithQuery] pubmed api key"
_api_key
_
<-
updateCorpusPubmedAPIKey
cid
(
Just
_api_key
)
_
<-
updateCorpusPubmedAPIKey
cid
_api_key
pure
()
_
->
pure
()
markStarted
3
jobHandle
...
...
src/Gargantext/API/Node/Corpus/Types.hs
View file @
0d383903
...
...
@@ -4,6 +4,7 @@ module Gargantext.API.Node.Corpus.Types where
import
Control.Lens
hiding
(
elements
,
Empty
)
import
Control.Monad.Fail
(
fail
)
import
Control.Monad.Reader
(
MonadReader
)
import
Data.Aeson
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Monoid
(
mempty
)
...
...
src/Gargantext/Database/Query/Table/Node.hs
View file @
0d383903
...
...
@@ -29,7 +29,6 @@ import Data.Text (Text)
import
Database.PostgreSQL.Simple.SqlQQ
(
sql
)
import
Opaleye
hiding
(
FromField
)
import
Prelude
hiding
(
null
,
id
,
map
,
sum
)
import
qualified
PUBMED.Types
as
PUBMED
import
Gargantext.Core
import
Gargantext.Core.Types
...
...
@@ -328,32 +327,6 @@ insertNodesWithParent pid ns = insertNodes (set node_parent_id (pgNodeId <$> pid
insertNodesWithParentR
::
Maybe
ParentId
->
[
NodeWrite
]
->
Cmd
err
[
NodeId
]
insertNodesWithParentR
pid
ns
=
insertNodesR
(
set
node_parent_id
(
pgNodeId
<$>
pid
)
<$>
ns
)
getCorpusPubmedAPIKey
::
NodeId
->
Cmd
err
(
Maybe
PUBMED
.
APIKey
)
getCorpusPubmedAPIKey
cId
=
do
res
<-
runPGSQuery
query
params
pure
$
(
\
(
PGS
.
Only
apiKey
)
->
apiKey
)
<$>
head
res
where
query
::
PGS
.
Query
query
=
[
sql
|
SELECT hyperdata -> 'pubmed_api_key'
FROM nodes
WHERE id = ?
|]
params
=
PGS
.
Only
cId
updateCorpusPubmedAPIKey
::
NodeId
->
Maybe
PUBMED
.
APIKey
->
Cmd
err
Int64
updateCorpusPubmedAPIKey
cId
mAPIKey
=
execPGSQuery
query
params
where
query
::
PGS
.
Query
query
=
[
sql
|
UPDATE nodes
SET hyperdata = hyperdata || ?
WHERE id = ?
|]
params
=
(
encode
$
object
[
"pubmed_api_key"
.=
mAPIKey
],
cId
)
------------------------------------------------------------------------
-- TODO
-- currently this function removes the child relation
...
...
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