This commit is contained in:
+5
-3
@@ -105,11 +105,13 @@ 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
|
||||
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"
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user