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

[FIX] cleaning Database.Node + clearer error message.

parent f730b1b0
......@@ -221,14 +221,11 @@ selectNodesWithType type_id = proc () -> do
restrict -< tn .== type_id
returnA -< row
getNode' :: Connection -> Int -> IO (Node Value)
getNode' c id = do
fromMaybe (error "TODO: 404") . headMay <$> runQuery c (limit 1 $ selectNode (pgInt4 id))
getNode :: Connection -> Int -> IO (Node Value)
getNode conn id = do
fromMaybe (error "TODO: 404") . headMay <$> runQuery conn (limit 1 $ selectNode (pgInt4 id))
fromMaybe (error $ "Node does node existe: " <> show id) . headMay <$> runQuery conn (limit 1 $ selectNode (pgInt4 id))
getNodesWithType :: Connection -> Column PGInt4 -> IO [Node HyperdataDocument]
getNodesWithType conn type_id = do
......
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