diff options
Diffstat (limited to 'Handler/LowItem.hs')
-rw-r--r-- | Handler/LowItem.hs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Handler/LowItem.hs b/Handler/LowItem.hs new file mode 100644 index 0000000..969e62a --- /dev/null +++ b/Handler/LowItem.hs | |||
@@ -0,0 +1,11 @@ | |||
1 | module Handler.LowItem where | ||
2 | |||
3 | import Import | ||
4 | |||
5 | postLowItemR :: ItemId -> Handler TypedContent | ||
6 | postLowItemR itemId = do | ||
7 | result <- fmap (Entity itemId) . runDB $ updateGet itemId [ ItemRunningLow =. True | ||
8 | ] | ||
9 | selectRep $ do | ||
10 | provideJson result | ||
11 | provideRep (redirect $ InventoryListingR :#: itemId :: Handler Html) | ||