timestamp gets updated at buying

This commit is contained in:
nek0 2016-03-18 00:00:41 +01:00
parent 6720907137
commit 4995783b9d

View file

@ -51,7 +51,9 @@ postBuyR uId bId = do
else do
let price = quant * (beveragePrice bev)
let sw = price > (userBalance user)
today <- liftIO $ return utctDay =<< getCurrentTime
runDB $ do
update uId [UserTimestamp =. today]
update uId [UserBalance -=. price]
update bId [BeverageAmount -=. quant]
checkAlert bId