mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-30 11:51:57 +00:00
augment default per page limit and parse it as int
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
{-# LANGUAGE TupleSections #-}
|
{-# LANGUAGE TupleSections #-}
|
||||||
{-# LANGUAGE TypeApplications #-}
|
{-# LANGUAGE TypeApplications #-}
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
|
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
|
||||||
{-# HLINT ignore "Redundant <$>" #-}
|
{-# HLINT ignore "Redundant <$>" #-}
|
||||||
|
|
||||||
@@ -335,7 +336,7 @@ getPackageListR = do
|
|||||||
PackageListRes <$> mapConcurrently constructPackageListApiRes pkgsWithDependencies
|
PackageListRes <$> mapConcurrently constructPackageListApiRes pkgsWithDependencies
|
||||||
where
|
where
|
||||||
defaults = PackageListDefaults { packageListOrder = DESC
|
defaults = PackageListDefaults { packageListOrder = DESC
|
||||||
, packageListPageLimit = 20
|
, packageListPageLimit = 100
|
||||||
, packageListPageNumber = 1
|
, packageListPageNumber = 1
|
||||||
, packageListCategory = Nothing
|
, packageListCategory = Nothing
|
||||||
, packageListQuery = ""
|
, packageListQuery = ""
|
||||||
@@ -377,7 +378,7 @@ getPackageListR = do
|
|||||||
let e = InvalidParamsE "get:per-page" pp
|
let e = InvalidParamsE "get:per-page" pp
|
||||||
$logWarn (show e)
|
$logWarn (show e)
|
||||||
sendResponseStatus status400 e
|
sendResponseStatus status400 e
|
||||||
Just l -> pure l
|
Just (l :: Int) -> pure l
|
||||||
getOsVersionQuery :: Handler (Maybe VersionRange)
|
getOsVersionQuery :: Handler (Maybe VersionRange)
|
||||||
getOsVersionQuery = lookupGetParam "eos-version-compat" >>= \case
|
getOsVersionQuery = lookupGetParam "eos-version-compat" >>= \case
|
||||||
Nothing -> pure Nothing
|
Nothing -> pure Nothing
|
||||||
|
|||||||
Reference in New Issue
Block a user