-- Database Actions

fetchAllBlogPosts :: DB.Pipe -> IO [BlogPost]
fetchAllBlogPosts pipe = do
  ps <- DB.access pipe DB.master "blogPosts" run
  return $ map documentToBlogPost ps
  where
    run = getAllBlogPosts
fetchAllBlogPosts :: DB.Pipe -> IO [BlogPost]
fetchAllBlogPosts pipe = do
  ps <- DB.access pipe DB.master "blogPosts" run
  return $ map documentToBlogPost ps
  where
    run = getAllBlogPosts
fetchAllBlogPosts pipe = do
  ps <- DB.access pipe DB.master "blogPosts" run
  return $ map documentToBlogPost ps
  where
    run = getAllBlogPosts