aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/app/Page/ListCollection.hs
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/Page/ListCollection.hs')
-rw-r--r--frontend/app/Page/ListCollection.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/frontend/app/Page/ListCollection.hs b/frontend/app/Page/ListCollection.hs
index ff659af..9e3caaa 100644
--- a/frontend/app/Page/ListCollection.hs
+++ b/frontend/app/Page/ListCollection.hs
@@ -8,26 +8,28 @@ module Page.ListCollection
where
import ACMS.API.REST.Collection qualified as API.REST.Collection
+import ACMS.API.REST.Collection.Paginated (Paginated (..))
+import ACMS.API.REST.Collection.Paginated qualified as API.REST.Collection.Paginated
+import Collection
import Control.Monad.Catch (SomeException, try)
import Data.Aeson qualified as A
import Data.Aeson.KeyMap qualified as AM
import Effect (Eff)
import Miso
import Schema
-import Collection
data Model = Model
{ collection :: Collection,
input :: A.Object,
schema :: Schema,
- posts :: [A.Object]
+ posts :: Paginated A.Object
}
deriving (Show, Eq)
initialModel :: Collection -> JSM (Either SomeException Model)
initialModel collection = do
schema' <- try (API.REST.Collection.schema collection)
- posts' <- try (API.REST.Collection.list collection)
+ posts' <- try (API.REST.Collection.Paginated.list (API.REST.Collection.Paginated.Pagination 10 0) collection)
pure do
schema <- schema'
posts <- posts'