diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-14 18:33:42 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-14 18:33:42 +0100 |
commit | 7bc954b779a9bc4e1c5e60f2648101c62ed22e72 (patch) | |
tree | b30851324772c14550c0444b7e79e36256f67900 /Handler/Item.hs | |
parent | 53fcf55c02f9335518c28d26429913258fc28f87 (diff) | |
download | bar-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.hs | 10 |
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 | ||
5 | getItemR :: ItemId -> Handler TypedContent | 5 | getItemR :: ItemId -> Handler TypedContent |
6 | getItemR itemId = do | 6 | getItemR 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 | ||
14 | putItemR :: ItemId -> Handler Value | 12 | putItemR :: ItemId -> Handler Value |
15 | putItemR itemId = do | 13 | putItemR itemId = do |