about summary refs log tree commit diff
path: root/src/Server.hs
diff options
context:
space:
mode:
authorVincent Ambo <vincent@spotify.com>2014-05-18T20·50+0200
committerVincent Ambo <vincent@spotify.com>2014-05-18T20·50+0200
commit41bee335c83ba7eb2f56241d41ccdd373c9a1a1a (patch)
tree889f6c2c0d3b6401a592216b0344ee2ac78a91a2 /src/Server.hs
parenta5481e70e4213595a9c48e0d73178ed9ffb9a073 (diff)
Refactor: Remove leftover comment functionality
Diffstat (limited to 'src/Server.hs')
-rw-r--r--src/Server.hs13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/Server.hs b/src/Server.hs
index bc1f51298b1a..f11f75c2deeb 100644
--- a/src/Server.hs
+++ b/src/Server.hs
@@ -32,7 +32,7 @@ instance FromReqURI BlogLang where
       _    -> Nothing
 
 tmpPolicy :: BodyPolicy
-tmpPolicy = defaultBodyPolicy "./tmp/" 0 200000 1000
+tmpPolicy = defaultBodyPolicy "/tmp" 0 200000 1000
 
 runBlog :: AcidState Blog -> Int -> String -> IO ()
 runBlog acid port respath =
@@ -62,9 +62,6 @@ tazBlog acid resDir = do
               dirs "admin/edit" $ path $ \(eId :: Integer) -> editEntry acid eId
          , do guardSession acid
               dirs "admin/updateentry" $ nullDir >> updateEntry acid
-         , do guardSession acid
-              dirs "admin/cdelete" $ path $ \(eId :: Integer) -> path $ \(cId :: String) ->
-                deleteComment acid (EntryId eId) cId
          , do dir "admin" nullDir
               guardSession acid
               ok $ toResponse $ adminIndex ("tazjin" :: Text)
@@ -144,7 +141,6 @@ postEntry acid = do
                     <*> pure nMtext
                     <*> pure now
                     <*> pure [] -- NYI
-                    <*> pure []
     update' acid (InsertEntry nEntry)
     seeOther ("/" ++ lang ++ "/" ++ show eId) (toResponse())
   where
@@ -181,13 +177,6 @@ updateEntry acid = do
     seeOther (concat $ intersperse' "/" [show $ lang entry, show eId])
              (toResponse ())
 
-deleteComment :: AcidState Blog -> EntryId -> String -> ServerPart Response
-deleteComment acid eId cId = do
-    nEntry <- update' acid (DeleteComment eId cDate)
-    ok $ toResponse $ commentDeleted eId
-  where
-    (cDate :: UTCTime) = fromJust $ parseTime defaultTimeLocale "%s%Q" cId
-
 guardSession :: AcidState Blog -> ServerPartT IO ()
 guardSession acid = do
     (sId :: Text) <- readCookieValue "session"