elPostR :: Text -> Handler Html
getDelPostR slug = do
    p <- runDB $ getBy $ UniquePost slug
    case p of
        Just (entityKey -> key) -> do
            runDB $ delete key
            setSuccessMessage "Inlägg raderat!"
        Nothing -> setErrorMessage "Inlägg ej funnet."
    redirect ManagePostsR

getDelPostR :: Text -> Handler Html
getDelPostR slug = do
    p <- runDB $ getBy $ UniquePost slug
    case p of
        Just (entityKey -> key) -> do
            runDB $ delete key
            setSuccessMessage "Inlägg raderat!"
        Nothing -> setErrorMessage "Inlägg ej funnet."
    redirect ManagePostsR
getDelPostR slug = do
    p <- runDB $ getBy $ UniquePost slug
    case p of
        Just (entityKey -> key) -> do
            runDB $ delete key
            setSuccessMessage "Inlägg raderat!"
        Nothing -> setErrorMessage "Inlägg ej funnet."
    redirect ManagePostsR