Remove unused Comment functionality from the scaffolding
This commit is contained in:
parent
d96bc12834
commit
0a230e7644
5 changed files with 0 additions and 63 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue