Store.save takes Track not Point

This commit is contained in:
Daniel Barlow 2024-11-07 16:42:53 +00:00
parent 04797427fc
commit 4ca505ada1
2 changed files with 2 additions and 2 deletions

View File

@ -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|<p>#{List.length points} points - thanks!|]
Left _ ->
defaultLayout

View File

@ -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