diff --git a/app/Main.hs b/app/Main.hs index cc1db6e..ed539ec 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -131,7 +131,7 @@ postUploadR = do bs <- fileSourceByteString $ fileInfo upload case Track.parseBS (fromStrict bs) of Right points -> do - runDB $ mapM_ Store.save points + runDB $ Store.save points defaultLayout [whamlet|
#{List.length points} points - thanks!|] Left _ -> defaultLayout diff --git a/lib/Store.hs b/lib/Store.hs index ec6d3d8..267c705 100644 --- a/lib/Store.hs +++ b/lib/Store.hs @@ -66,7 +66,7 @@ toPoint entity = (trkptPower tkp) (trkptHeartRate tkp) -save p = do insert $ fromPoint p +save p = do mapM_ (insert . fromPoint) p fetch :: (MonadIO m) => UTCTime -> NominalDiffTime -> ReaderT SqlBackend m [Point] fetch start duration = do