module Handler.OpenItem where import Import postOpenItemR :: ItemId -> Handler TypedContent postOpenItemR itemId = do today <- utctDay <$> liftIO getCurrentTime result <- fmap (Entity itemId) . runDB $ updateGet itemId [ ItemOpened =. DateKnown today ] selectRep $ do provideJson result provideRep (redirect $ InventoryListingR :#: itemId :: Handler Html)