Skip to content
Permalink
Browse files

posts: order id descending

  • Loading branch information...
3v0k4 committed Jul 20, 2019
1 parent b90b5cc commit 716817e7b54310fd1b588e4a77db5d199e084383
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Handler/Posts.hs
@@ -18,14 +18,14 @@ postForm =
getPostsR :: Handler Html
getPostsR = do
(widget, enctype) <- generateFormPost postForm
allPosts :: [Entity Post] <- runDB $ selectList [] []
allPosts :: [Entity Post] <- runDB $ selectList [] [ Desc PostId ]
emptyLayout $ do
$(widgetFile "posts")

postPostsR :: Handler Html
postPostsR = do
((result, widget), enctype) <- runFormPost postForm
allPosts :: [Entity Post] <- runDB $ selectList [] []
allPosts :: [Entity Post] <- runDB $ selectList [] [ Desc PostId ]
case result of
FormSuccess post -> do
_ <- runDB $ insert post

0 comments on commit 716817e

Please sign in to comment.
You can’t perform that action at this time.