use estimated post counts

This commit is contained in:
towards-a-new-leftypol 2024-01-22 13:46:29 -05:00
parent 013a04a7d2
commit 75024b1fd0
4 changed files with 6 additions and 5 deletions

View File

@ -3,7 +3,7 @@
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="postgrest-root" content="http://10.4.0.96:3000"> <meta name="postgrest-root" content="http://10.4.0.96:3000">
<meta name="postgrest-fetch-count" content="200"> <meta name="postgrest-fetch-count" content="1000">
<title>Chandlr</title> <title>Chandlr</title>
<link href="static/style.css" rel="stylesheet" /> <link href="static/style.css" rel="stylesheet" />
<script language="javascript" src="./dist/build/chandlr/chandlr.jsexe/rts.js"></script> <script language="javascript" src="./dist/build/chandlr/chandlr.jsexe/rts.js"></script>

View File

@ -94,7 +94,7 @@ gridItem post =
body = map (rawHtml . toMisoString) $ maybeToList $ CatalogPost.body post body = map (rawHtml . toMisoString) $ maybeToList $ CatalogPost.body post
post_count_str :: MisoString 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 :: MisoString
thread_url = toMisoString $ intercalate "/" thread_url = toMisoString $ intercalate "/"

View File

@ -133,7 +133,7 @@ mainUpdate (HaveLatest (Client.HttpResponse {..})) m = m <#
consoleLog "Didn't get anything back from API" consoleLog "Didn't get anything back from API"
return NoAction return NoAction
Just posts -> do Just posts -> do
mapM_ (consoleLog . toJSString . show) posts -- mapM_ (consoleLog . toJSString . show) posts
return $ GridAction $ Grid.DisplayItems posts return $ GridAction $ Grid.DisplayItems posts
mainUpdate GetLatest m = m <# Client.fetchLatest (clientModel m) iClient mainUpdate GetLatest m = m <# Client.fetchLatest (clientModel m) iClient
@ -165,7 +165,7 @@ iClient = Client.Interface
- TODO: - TODO:
- - Create Hello World page render - - Create Hello World page render
- - Create CatalogGrid component (static at first) - - 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? - - 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 - - if I want to use the isomorphic feature of miso, then yes

View File

@ -22,7 +22,8 @@ data CatalogPost = CatalogPost
, subject :: Maybe Text , subject :: Maybe Text
, email :: Maybe Text , email :: Maybe Text
, thread_id :: Int , thread_id :: Int
, post_count :: Int -- , post_count :: Int
, estimated_post_count :: Int
, site_name :: String , site_name :: String
, pathpart :: String , pathpart :: String
--, site_id :: Int --, site_id :: Int