From 518d62fcb6956c142f2079c2ec1cca6ea3e4ab8b Mon Sep 17 00:00:00 2001 From: James Brechtel Date: Sun, 31 May 2026 14:46:58 -0400 Subject: [PATCH] HLint --- src/Roux/CookLog.hs | 2 +- src/Roux/Server.hs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Roux/CookLog.hs b/src/Roux/CookLog.hs index df15c8d..cd9fd2f 100644 --- a/src/Roux/CookLog.hs +++ b/src/Roux/CookLog.hs @@ -131,4 +131,4 @@ fetchAllEntries conn = SQL.query_ conn "SELECT id, recipe_filename, cooked_date, comment, created_at \ - \ FROM cook_log ORDER BY cooked_date DESC, id DESC" + \ FROM cook_log ORDER BY cooked_date ASC, id DESC" diff --git a/src/Roux/Server.hs b/src/Roux/Server.hs index c52f42b..6aa07e2 100644 --- a/src/Roux/Server.hs +++ b/src/Roux/Server.hs @@ -668,9 +668,10 @@ handleRequest recipeDir state db request respond = do entries <- CookLog.fetchAllEntries db let grouped = groupEntries entries recipeTitleLookup fn = - case Map.lookup (map toLower (stripCookExt (T.unpack fn))) recipes of - Just info -> Idx.riTitle info - Nothing -> fn + maybe + fn + Idx.riTitle + (Map.lookup (map toLower (stripCookExt (T.unpack fn))) recipes) respond $ htmlResponse (Html.cookHistoryPage recipeTitleLookup grouped) -- Cook log JSON endpoint for all entries ["cook-log"] -> do