diff --git a/Handler/Album.hs b/Handler/Album.hs index a258e65..85a0d02 100644 --- a/Handler/Album.hs +++ b/Handler/Album.hs @@ -17,7 +17,8 @@ getAlbumR albumId = do return (userId == ownerId) Nothing -> return False - media <- mapM (\a -> runDB $ getJust a) (albumContent album) +-- media <- mapM (\a -> runDB $ getJust a) (albumContent album) + media <- runDB $ selectList [MediumAlbum ==. albumId] [Desc MediumTime] defaultLayout $ do $(widgetFile "album") Nothing -> do diff --git a/templates/album.hamlet b/templates/album.hamlet index 6734980..e20bb1c 100644 --- a/templates/album.hamlet +++ b/templates/album.hamlet @@ -9,7 +9,8 @@ by #{ownerName} This album is empty $else Images in this album: - $forall (medium) <- media + $forall (Entity mediumId medium) <- media