Commit 6e7d829b authored by Alexandre Delanoë's avatar Alexandre Delanoë

[COSMETICS] in query

parent 76f0419f
...@@ -124,12 +124,12 @@ getNodesWithParentId conn n = runQuery conn $ selectNodeWithParentID n ...@@ -124,12 +124,12 @@ getNodesWithParentId conn n = runQuery conn $ selectNodeWithParentID n
selectNodeWithParentID :: Int -> Query NodeRead selectNodeWithParentID :: Int -> Query NodeRead
selectNodeWithParentID n = proc () -> do selectNodeWithParentID n = proc () -> do
row@(Node _id _tn _u p_id _n _d _h) <- queryNodeTable -< () row@(Node _ _ _ parent_id _ _ _) <- queryNodeTable -< ()
restrict -< if n > 0 restrict -< if n > 0
then then
p_id .== (toNullable $ pgInt4 n) parent_id .== (toNullable $ pgInt4 n)
else else
isNull p_id isNull parent_id
returnA -< row returnA -< row
queryNodeTable :: Query NodeRead queryNodeTable :: Query NodeRead
......
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