From 127d763a6a68d8fd242e093ba9f55bf769635842 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Mar 2017 20:11:41 +0100 Subject: Make typing many items more efficient --- Handler/InventoryListing.hs | 2 +- Handler/ReferenceListing.hs | 2 +- Handler/UpdateItem.hs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Handler') diff --git a/Handler/InventoryListing.hs b/Handler/InventoryListing.hs index cbf4eab..c2ec5d1 100644 --- a/Handler/InventoryListing.hs +++ b/Handler/InventoryListing.hs @@ -16,7 +16,7 @@ postInventoryListingR = do FormFailure errors -> mapM_ (addMessage "formError" . toHtml) errors _ -> return () - (stockSort -> stock) <- runDB $ mapM withType =<< selectList [] [] + (stockSort -> stock) <- runDB $ withTypes =<< selectList [] [] selectRep $ do provideJson (stock :: [WithType (Entity Item)]) diff --git a/Handler/ReferenceListing.hs b/Handler/ReferenceListing.hs index e433429..690f3f7 100644 --- a/Handler/ReferenceListing.hs +++ b/Handler/ReferenceListing.hs @@ -17,7 +17,7 @@ postReferenceListingR = do FormFailure errors -> mapM_ (addMessage "formError" . toHtml) errors _ -> return () - (referenceSort -> reference) <- runDB $ mapM withType =<< selectList [] [Asc ReferenceKind] + (referenceSort -> reference) <- runDB $ withTypes =<< selectList [] [Asc ReferenceKind] selectRep $ do provideJson (reference :: [WithType (Entity Reference)]) diff --git a/Handler/UpdateItem.hs b/Handler/UpdateItem.hs index 503d8ca..b4c8713 100644 --- a/Handler/UpdateItem.hs +++ b/Handler/UpdateItem.hs @@ -28,7 +28,7 @@ postUpdateItemR fsUpdateId = do provideRep $ case updateResult of FormSuccess _ -> redirect $ InventoryListingR :#: fsUpdateId :: Handler Html _ -> do - (stockSort -> stock) <- runDB $ mapM withType =<< selectList [] [] + (stockSort -> stock) <- runDB $ withTypes =<< selectList [] [] defaultLayout $ inventoryListing InventoryState { invFormState = Just UpdateForm{..} , .. -- cgit v1.2.3