summaryrefslogtreecommitdiff
path: root/Handler/Item.hs
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-03-14 18:33:42 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2017-03-14 18:33:42 +0100
commit7bc954b779a9bc4e1c5e60f2648101c62ed22e72 (patch)
treeb30851324772c14550c0444b7e79e36256f67900 /Handler/Item.hs
parent53fcf55c02f9335518c28d26429913258fc28f87 (diff)
downloadbar-7bc954b779a9bc4e1c5e60f2648101c62ed22e72.tar
bar-7bc954b779a9bc4e1c5e60f2648101c62ed22e72.tar.gz
bar-7bc954b779a9bc4e1c5e60f2648101c62ed22e72.tar.bz2
bar-7bc954b779a9bc4e1c5e60f2648101c62ed22e72.tar.xz
bar-7bc954b779a9bc4e1c5e60f2648101c62ed22e72.zip
Reference & list
Diffstat (limited to 'Handler/Item.hs')
-rw-r--r--Handler/Item.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/Handler/Item.hs b/Handler/Item.hs
index 87030bb..0f48261 100644
--- a/Handler/Item.hs
+++ b/Handler/Item.hs
@@ -4,12 +4,10 @@ import Import
4 4
5getItemR :: ItemId -> Handler TypedContent 5getItemR :: ItemId -> Handler TypedContent
6getItemR itemId = do 6getItemR itemId = do
7 eLookup <- runDB $ fmap (Entity itemId) <$> get itemId 7 entity <- runDB $ Entity itemId <$> get404 itemId
8 case eLookup of 8 selectRep $ do
9 Nothing -> notFound 9 provideJson entity
10 Just entity -> selectRep $ do 10 provideRep (redirect $ InventoryListingR :#: itemId :: Handler Html)
11 provideJson entity
12 provideRep (redirect $ InventoryListingR :#: itemId :: Handler Html)
13 11
14putItemR :: ItemId -> Handler Value 12putItemR :: ItemId -> Handler Value
15putItemR itemId = do 13putItemR itemId = do