summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2018-01-23 10:16:50 -0800
committerBen Sima <ben@bsima.me>2018-01-23 10:16:50 -0800
commit27c960910494b51a98d0d4d76bbdf49917198c0e (patch)
tree17d2f20a7cfd6e6a7b775effa7f1d4517ffc279d
parent3560aad683d32b2719d9abd0e52dbe536d8a416b (diff)
Switch to more-correct versions of update/query fns
-rwxr-xr-xmain.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/main.hs b/main.hs
index e383359..ff2c0a1 100755
--- a/main.hs
+++ b/main.hs
@@ -27,7 +27,6 @@
{-# LANGUAGE RecordWildCards #-}
import Data.Acid
-import Data.Acid.Advanced (update', query')
import Data.Acid.Local (createCheckpointAndClose)
import qualified Data.ByteString.Lazy as BSL
import qualified Data.Csv as Csv
@@ -184,14 +183,13 @@ getQueryR = do
Nothing -> do
app <- getYesod
let db = appState app
- callers <- query' db $ ViewCallers 20
+ callers <- liftIO $ query db $ ViewCallers 20
sendStatusJSON status200 $ object [ "results" .= callers ]
Just q -> do
app <- getYesod
let db = appState app
- caller <- query' db $ CallerByNumber $ PhoneNumber q
- $logInfo $ pack $ show caller
+ caller <- liftIO $ query db $ CallerByNumber $ PhoneNumber q
sendStatusJSON status200 $ object [ "results" .= caller ]
data PostRequest = PostRequest