From 9f94013ddc1b6ac7256b9cebcf8685949ce88c34 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 16 Jul 2017 23:31:22 +0200 Subject: Quick Action for running low --- Handler/LowItem.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Handler/LowItem.hs (limited to 'Handler') 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 @@ +module Handler.LowItem where + +import Import + +postLowItemR :: ItemId -> Handler TypedContent +postLowItemR itemId = do + result <- fmap (Entity itemId) . runDB $ updateGet itemId [ ItemRunningLow =. True + ] + selectRep $ do + provideJson result + provideRep (redirect $ InventoryListingR :#: itemId :: Handler Html) -- cgit v1.2.3