diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-14 01:06:28 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2017-03-14 01:06:28 +0100 |
commit | d84b462a711ce95593ff05a7581e722562c3835a (patch) | |
tree | 41e5af455fea925b2680b29718b24ba2876e803a /Handler/OpenItem.hs | |
download | bar-d84b462a711ce95593ff05a7581e722562c3835a.tar bar-d84b462a711ce95593ff05a7581e722562c3835a.tar.gz bar-d84b462a711ce95593ff05a7581e722562c3835a.tar.bz2 bar-d84b462a711ce95593ff05a7581e722562c3835a.tar.xz bar-d84b462a711ce95593ff05a7581e722562c3835a.zip |
Implement old bar.hs
Diffstat (limited to 'Handler/OpenItem.hs')
-rw-r--r-- | Handler/OpenItem.hs | 12 |
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 @@ | |||
1 | module Handler.OpenItem where | ||
2 | |||
3 | import Import | ||
4 | |||
5 | postOpenItemR :: ItemId -> Handler TypedContent | ||
6 | postOpenItemR 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) | ||