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

@ -49,7 +49,6 @@ import System.Log.FastLogger (defaultBufSize, newStdoutLoggerSet,
-- Don't forget to add new modules to your cabal file!
import Handler.Common
import Handler.Home
import Handler.Comment
import Handler.Profile
-- This line actually creates our YesodDispatch instance. It is the second half

View file

@ -150,7 +150,6 @@ instance Yesod App where
-- Routes not requiring authentication.
isAuthorized (AuthR _) _ = return Authorized
isAuthorized CommentR _ = return Authorized
isAuthorized HomeR _ = return Authorized
isAuthorized FaviconR _ = return Authorized
isAuthorized RobotsR _ = return Authorized

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