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

[FIX] mkNode.

parent ecc9c601
Pipeline #650 failed with stage
...@@ -38,7 +38,7 @@ Node API ...@@ -38,7 +38,7 @@ Node API
module Gargantext.API.Node module Gargantext.API.Node
where where
import Control.Lens ((.~), (?~)) import Control.Lens ((.~), (?~), (^.))
import Control.Monad ((>>), forM) import Control.Monad ((>>), forM)
import Control.Monad.IO.Class (liftIO) import Control.Monad.IO.Class (liftIO)
import Data.Aeson (FromJSON, ToJSON) import Data.Aeson (FromJSON, ToJSON)
...@@ -334,7 +334,10 @@ rename :: NodeId -> RenameNode -> Cmd err [Int] ...@@ -334,7 +334,10 @@ rename :: NodeId -> RenameNode -> Cmd err [Int]
rename nId (RenameNode name') = U.update (U.Rename nId name') rename nId (RenameNode name') = U.update (U.Rename nId name')
postNode :: HasNodeError err => UserId -> NodeId -> PostNode -> Cmd err [NodeId] postNode :: HasNodeError err => UserId -> NodeId -> PostNode -> Cmd err [NodeId]
postNode uId pId (PostNode nodeName nt) = mkNodeWithParent nt (Just pId) uId nodeName postNode uId pId (PostNode nodeName nt) = do
nodeUser <- getNode (NodeId uId) HyperdataUser
let uId' = nodeUser ^. node_userId
mkNodeWithParent nt (Just pId) uId' nodeName
putNode :: NodeId -> Cmd err Int putNode :: NodeId -> Cmd err Int
putNode = undefined -- TODO putNode = undefined -- TODO
......
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