summaryrefslogtreecommitdiff
path: root/Handler/Item.hs
diff options
context:
space:
mode:
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