Commit 5ac5860a authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] Removing selectNodeWithParentId function.

parent 6e7d829b
...@@ -120,10 +120,10 @@ runGetNodes = runQuery ...@@ -120,10 +120,10 @@ runGetNodes = runQuery
-- NP check type -- NP check type
getNodesWithParentId :: Connection -> Int -> IO [Node Value] getNodesWithParentId :: Connection -> Int -> IO [Node Value]
getNodesWithParentId conn n = runQuery conn $ selectNodeWithParentID n getNodesWithParentId conn n = runQuery conn $ selectNodesWithParentID n
selectNodeWithParentID :: Int -> Query NodeRead selectNodesWithParentID :: Int -> Query NodeRead
selectNodeWithParentID n = proc () -> do selectNodesWithParentID n = proc () -> do
row@(Node _ _ _ parent_id _ _ _) <- queryNodeTable -< () row@(Node _ _ _ parent_id _ _ _) <- queryNodeTable -< ()
restrict -< if n > 0 restrict -< if n > 0
then then
...@@ -138,7 +138,6 @@ queryNodeTable = queryTable nodeTable ...@@ -138,7 +138,6 @@ queryNodeTable = queryTable nodeTable
selectNodesWithType :: Column PGInt4 -> Query NodeRead selectNodesWithType :: Column PGInt4 -> Query NodeRead
selectNodesWithType type_id = proc () -> do selectNodesWithType type_id = proc () -> do
row@(Node _ tn _ _ _ _ _) <- queryNodeTable -< () row@(Node _ tn _ _ _ _ _) <- queryNodeTable -< ()
...@@ -156,9 +155,9 @@ getNodesWithType conn type_id = do ...@@ -156,9 +155,9 @@ getNodesWithType conn type_id = do
-- NP check type -- NP check type
getCorpusDocument :: Connection -> Int -> IO [Document] getCorpusDocument :: Connection -> Int -> IO [Document]
getCorpusDocument conn n = runQuery conn (selectNodeWithParentID n) getCorpusDocument conn n = runQuery conn (selectNodesWithParentID n)
-- NP check type -- NP check type
getProjectCorpora :: Connection -> Int -> IO [Corpus] getProjectCorpora :: Connection -> Int -> IO [Corpus]
getProjectCorpora conn node_id = do getProjectCorpora conn node_id = do
runQuery conn $ selectNodeWithParentID node_id runQuery conn $ selectNodesWithParentID node_id
...@@ -20,7 +20,7 @@ import Database.PostgreSQL.Simple (Connection, connect) ...@@ -20,7 +20,7 @@ import Database.PostgreSQL.Simple (Connection, connect)
import Opaleye import Opaleye
import Data.Gargantext.Types.Main (Node, NodeId) import Data.Gargantext.Types.Main (Node, NodeId)
import Data.Gargantext.Database.Node (getNodesWithParentId, getNode, getNodesWithType) import Data.Gargantext.Database.Node (getNodesWithParentId, getNode)
import Data.Gargantext.Database.Private (infoGargandb) import Data.Gargantext.Database.Private (infoGargandb)
-- | TODO, use MOCK feature of Servant to generate fake data (for tests) -- | TODO, use MOCK feature of Servant to generate fake data (for tests)
......
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