summaryrefslogtreecommitdiff
path: root/Handler/LowItem.hs
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-07-16 23:31:22 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2017-07-16 23:31:22 +0200
commit9f94013ddc1b6ac7256b9cebcf8685949ce88c34 (patch)
tree217f6c6de0e6df13f1537deac15e3b4bfa93312f /Handler/LowItem.hs
parent37c09531ec4986df3c5bc12737273b059d35f2b3 (diff)
downloadbar-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/LowItem.hs')
-rw-r--r--Handler/LowItem.hs11
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 @@
1module Handler.LowItem where
2
3import Import
4
5postLowItemR :: ItemId -> Handler TypedContent
6postLowItemR 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)