From 75024b1fd09bebdb7a2d34a5b0d3809d10d4ea42 Mon Sep 17 00:00:00 2001 From: towards-a-new-leftypol Date: Mon, 22 Jan 2024 13:46:29 -0500 Subject: [PATCH] use estimated post counts --- index.html | 2 +- src/Component/CatalogGrid.hs | 2 +- src/Main.hs | 4 ++-- src/Network/CatalogPostType.hs | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 6ed6bcb..6757ff5 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - + Chandlr diff --git a/src/Component/CatalogGrid.hs b/src/Component/CatalogGrid.hs index 443b376..e4f545a 100644 --- a/src/Component/CatalogGrid.hs +++ b/src/Component/CatalogGrid.hs @@ -94,7 +94,7 @@ gridItem post = body = map (rawHtml . toMisoString) $ maybeToList $ CatalogPost.body post post_count_str :: MisoString - post_count_str = "R: " `append` (toMisoString $ CatalogPost.post_count post) + post_count_str = "R: " `append` (toMisoString $ CatalogPost.estimated_post_count post) `append` "+" thread_url :: MisoString thread_url = toMisoString $ intercalate "/" diff --git a/src/Main.hs b/src/Main.hs index d8ecc55..a598e24 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -133,7 +133,7 @@ mainUpdate (HaveLatest (Client.HttpResponse {..})) m = m <# consoleLog "Didn't get anything back from API" return NoAction Just posts -> do - mapM_ (consoleLog . toJSString . show) posts + -- mapM_ (consoleLog . toJSString . show) posts return $ GridAction $ Grid.DisplayItems posts mainUpdate GetLatest m = m <# Client.fetchLatest (clientModel m) iClient @@ -165,7 +165,7 @@ iClient = Client.Interface - TODO: - - Create Hello World page render ✓ - - Create CatalogGrid component (static at first) ✓ - - - Get postgrest url from page header and perform an initial xhr request + - - Get postgrest url from page header and perform an initial xhr request ✓ - - - do I need to move out everything into another project called chandlr-common? - - if I want to use the isomorphic feature of miso, then yes diff --git a/src/Network/CatalogPostType.hs b/src/Network/CatalogPostType.hs index 92808d0..c1c4ee0 100644 --- a/src/Network/CatalogPostType.hs +++ b/src/Network/CatalogPostType.hs @@ -22,7 +22,8 @@ data CatalogPost = CatalogPost , subject :: Maybe Text , email :: Maybe Text , thread_id :: Int - , post_count :: Int + -- , post_count :: Int + , estimated_post_count :: Int , site_name :: String , pathpart :: String --, site_id :: Int