Cleanup identified tables
This commit is contained in:
parent
d47fa717a3
commit
907958baf4
@ -4,6 +4,7 @@
|
|||||||
, OverloadedStrings
|
, OverloadedStrings
|
||||||
, TemplateHaskell
|
, TemplateHaskell
|
||||||
, LambdaCase
|
, LambdaCase
|
||||||
|
, ViewPatterns
|
||||||
#-}
|
#-}
|
||||||
|
|
||||||
module Handler.Utils.Table.Pagination where
|
module Handler.Utils.Table.Pagination where
|
||||||
@ -70,7 +71,7 @@ instance Default PSValidator where
|
|||||||
tell . pure $ SomeMessage MsgPSLimitNonPositive
|
tell . pure $ SomeMessage MsgPSLimitNonPositive
|
||||||
|
|
||||||
dbTable :: PSValidator -> DBTable -> Handler Widget
|
dbTable :: PSValidator -> DBTable -> Handler Widget
|
||||||
dbTable PSValidator{..} DBTable{..} = do
|
dbTable PSValidator{..} DBTable{ dbtIdent = (toPathPiece -> dbtIdent), .. } = do
|
||||||
let
|
let
|
||||||
sortingOptions = mkOptionList
|
sortingOptions = mkOptionList
|
||||||
[ Option t' (c, d) t'
|
[ Option t' (c, d) t'
|
||||||
@ -84,7 +85,9 @@ dbTable PSValidator{..} DBTable{..} = do
|
|||||||
Nothing -> return $ Left "Error parsing values"
|
Nothing -> return $ Left "Error parsing values"
|
||||||
Just res -> return $ Right $ Just res
|
Just res -> return $ Right $ Just res
|
||||||
(_, defPS) = runPSValidator Nothing
|
(_, defPS) = runPSValidator Nothing
|
||||||
wIdent n = toPathPiece dbtIdent <> "-" <> n
|
wIdent n
|
||||||
|
| not $ null dbtIdent = dbtIdent <> "-" <> n
|
||||||
|
| otherwise = n
|
||||||
|
|
||||||
psResult <- runInputGetResult $ PaginationSettings
|
psResult <- runInputGetResult $ PaginationSettings
|
||||||
<$> ireq sortingField (wIdent "sorting")
|
<$> ireq sortingField (wIdent "sorting")
|
||||||
|
|||||||
Reference in New Issue
Block a user