summaryrefslogtreecommitdiff
path: root/Handler/OpenItem.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Handler/OpenItem.hs')
-rw-r--r--Handler/OpenItem.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/Handler/OpenItem.hs b/Handler/OpenItem.hs
new file mode 100644
index 0000000..468c6ec
--- /dev/null
+++ b/Handler/OpenItem.hs
@@ -0,0 +1,12 @@
1module Handler.OpenItem where
2
3import Import
4
5postOpenItemR :: ItemId -> Handler TypedContent
6postOpenItemR itemId = do
7 today <- utctDay <$> liftIO getCurrentTime
8 result <- fmap (Entity itemId) . runDB $ updateGet itemId [ ItemOpened =. Just today
9 ]
10 selectRep $ do
11 provideJson result
12 provideRep (redirect $ InventoryListingR :#: itemId :: Handler Html)