diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2017-07-16 23:31:22 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2017-07-16 23:31:22 +0200 |
commit | 9f94013ddc1b6ac7256b9cebcf8685949ce88c34 (patch) | |
tree | 217f6c6de0e6df13f1537deac15e3b4bfa93312f /Handler | |
parent | 37c09531ec4986df3c5bc12737273b059d35f2b3 (diff) | |
download | bar-9f94013ddc1b6ac7256b9cebcf8685949ce88c34.tar bar-9f94013ddc1b6ac7256b9cebcf8685949ce88c34.tar.gz bar-9f94013ddc1b6ac7256b9cebcf8685949ce88c34.tar.bz2 bar-9f94013ddc1b6ac7256b9cebcf8685949ce88c34.tar.xz bar-9f94013ddc1b6ac7256b9cebcf8685949ce88c34.zip |
Quick Action for running low
Diffstat (limited to 'Handler')
-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) | ||