Commit aa986303 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[GRAPH] Db fix.

parent 304c4372
Pipeline #642 failed with stage
...@@ -24,7 +24,7 @@ Portability : POSIX ...@@ -24,7 +24,7 @@ Portability : POSIX
module Gargantext.Viz.Graph.API module Gargantext.Viz.Graph.API
where where
import Control.Lens -- (set, (^.), (_Just), (^?)) import Control.Lens (set, (^.), _Just, (^?))
import Control.Monad.IO.Class (liftIO) import Control.Monad.IO.Class (liftIO)
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Gargantext.API.Ngrams (currentVersion) import Gargantext.API.Ngrams (currentVersion)
...@@ -70,6 +70,9 @@ getGraph uId nId = do ...@@ -70,6 +70,9 @@ getGraph uId nId = do
. gm_version . gm_version
v <- currentVersion v <- currentVersion
nodeUser <- getNode (NodeId uId) HyperdataUser
let uId' = nodeUser ^. node_userId
let cId = maybe (panic "[ERR:G.V.G.API] Node has no parent") let cId = maybe (panic "[ERR:G.V.G.API] Node has no parent")
identity identity
...@@ -77,7 +80,7 @@ getGraph uId nId = do ...@@ -77,7 +80,7 @@ getGraph uId nId = do
case graph of case graph of
Nothing -> do Nothing -> do
graph' <- computeGraph cId NgramsTerms v graph' <- computeGraph cId NgramsTerms v
_ <- insertGraph cId uId (HyperdataGraph $ Just graph') _ <- insertGraph cId uId' (HyperdataGraph $ Just graph')
pure graph' pure graph'
Just graph' -> if graphVersion == Just v Just graph' -> if graphVersion == Just v
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment