Remove unused Comment functionality from the scaffolding

This commit is contained in:
Danielle McLean 2017-10-03 13:31:53 +11:00
parent d96bc12834
commit 0a230e7644
Signed by: 00dani
GPG key ID: 3844A6973C6058F1
5 changed files with 0 additions and 63 deletions

View file

@ -1,16 +0,0 @@
module Handler.Comment where
import Import
postCommentR :: Handler Value
postCommentR = do
-- requireJsonBody will parse the request body into the appropriate type, or return a 400 status code if the request JSON is invalid.
-- (The ToJSON and FromJSON instances are derived in the config/models file).
comment <- (requireJsonBody :: Handler Comment)
-- The YesodAuth instance in Foundation.hs defines the UserId to be the type used for authentication.
maybeCurrentUserId <- maybeAuthId
let comment' = comment { commentUserId = maybeCurrentUserId }
insertedComment <- runDB $ insertEntity comment'
returnJson insertedComment