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
198
Issues
198
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
73b0ba2c
Commit
73b0ba2c
authored
Jul 23, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Add Category not null.
parent
bb3587d3
Pipeline
#524
failed with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
Node.hs
src/Gargantext/API/Node.hs
+1
-1
Learn.hs
src/Gargantext/Database/Learn.hs
+0
-2
Add.hs
src/Gargantext/Database/Node/Document/Add.hs
+4
-3
No files found.
src/Gargantext/API/Node.hs
View file @
73b0ba2c
...
...
@@ -215,7 +215,7 @@ instance Arbitrary PostNode where
arbitrary
=
elements
[
PostNode
"Node test"
NodeCorpus
]
------------------------------------------------------------------------
type
CatApi
=
Summary
" To Categorize NodeNodes"
type
CatApi
=
Summary
" To Categorize NodeNodes
: 0 for delete, 1/null neutral, 2 favorite
"
:>
ReqBody
'[
J
SON
]
NodesToCategory
:>
Put
'[
J
SON
]
[
Int
]
...
...
src/Gargantext/Database/Learn.hs
View file @
73b0ba2c
...
...
@@ -38,10 +38,8 @@ data FavOrTrash = IsFav | IsTrash
deriving
(
Eq
)
--moreLike :: FlowCmdM env error m => FavOrTrash -> CorpusId -> m (Events Bool, [FacetDoc])
moreLike
::
FlowCmdM
DevEnv
GargError
m
=>
FavOrTrash
->
CorpusId
->
m
[
FacetDoc
]
moreLike
ft
cId
=
do
priors
<-
getPriors
ft
cId
...
...
src/Gargantext/Database/Node/Document/Add.hs
View file @
73b0ba2c
...
...
@@ -55,14 +55,14 @@ add_debug pId ns = formatPGSQuery queryAdd (Only $ Values fields inputData)
-- | Input Tables: types of the tables
inputSqlTypes
::
[
Text
]
inputSqlTypes
=
[
"int4"
,
"int4"
]
inputSqlTypes
=
[
"int4"
,
"int4"
,
"int4"
]
-- | SQL query to add documents
-- TODO return id of added documents only
queryAdd
::
Query
queryAdd
=
[
sql
|
WITH input_rows(node1_id,node2_id) AS (?)
INSERT INTO nodes_nodes (node1_id, node2_id)
WITH input_rows(node1_id,node2_id
,category
) AS (?)
INSERT INTO nodes_nodes (node1_id, node2_id
,category
)
SELECT * FROM input_rows
ON CONFLICT (node1_id, node2_id) DO NOTHING -- on unique index
RETURNING 1
...
...
@@ -83,5 +83,6 @@ data InputData = InputData { inNode1_id :: NodeId
instance
ToRow
InputData
where
toRow
inputData
=
[
toField
(
inNode1_id
inputData
)
,
toField
(
inNode2_id
inputData
)
,
toField
(
1
::
Int
)
]
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