diff --git a/src/Roux/CookLog.hs b/src/Roux/CookLog.hs index b11d87c..df15c8d 100644 --- a/src/Roux/CookLog.hs +++ b/src/Roux/CookLog.hs @@ -105,15 +105,17 @@ insertEntry conn filename day mComment = do fromMaybe d Nothing = d fromMaybe _ (Just x) = x --- | Fetch all entries for a given recipe, newest first. --- Tries both the normalized key and with @.cook@ appended (for legacy entries). +{- | Fetch all entries for a given recipe, newest first. +Tries both the normalized key and with @.cook@ appended (for legacy entries). +-} fetchEntries :: Connection -> Text -> IO [CookEntry] fetchEntries conn filename = do - entries <- SQL.query - conn - "SELECT id, recipe_filename, cooked_date, comment, created_at \ - \ FROM cook_log WHERE recipe_filename = ? ORDER BY cooked_date DESC, id DESC" - (Only filename) + entries <- + SQL.query + conn + "SELECT id, recipe_filename, cooked_date, comment, created_at \ + \ FROM cook_log WHERE recipe_filename = ? ORDER BY cooked_date DESC, id DESC" + (Only filename) if null entries then SQL.query diff --git a/src/Roux/Server.hs b/src/Roux/Server.hs index c94931a..14acc2a 100644 --- a/src/Roux/Server.hs +++ b/src/Roux/Server.hs @@ -21,9 +21,9 @@ import qualified Data.ByteString.Lazy as LB import Data.Char (digitToInt, isAlphaNum, toLower) import Data.IORef (IORef, atomicModifyIORef', newIORef, readIORef, writeIORef) import Data.List (isSuffixOf, sortOn) -import Data.Ord (Down (Down)) import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map +import Data.Ord (Down (Down)) import Data.Text (Text) import qualified Data.Text as T import Data.Text.Encoding (encodeUtf8)