module Handler.Home where

import Import hiding (on, (==.))
import Database.Esqueleto
import qualified Database.Esqueleto as E

getProfileR :: Handler Html
getProfileR = do
  userId <- requireAuthId

  items <- runDB $ select $ from $ \(r `LeftOuterJoin` u) -> do
             on (r ^. ReadableId ==. u ^. UserReadingReadableId)
             where_ (u ^. UserReadingUserId ==. val userId)

  defaultLayout $(widgetFile "profile")

module Handler.Home where

import Control.Lens hiding (from, on)
import Import hiding (on, (==.))
import Database.Esqueleto hiding ((^.))
import qualified Database.Esqueleto as E

getProfileR :: Handler Html
getProfileR = do
  userId <- requireAuthId

  items <- runDB $ select $ from $ \(r `LeftOuterJoin` u) -> do
             on (r E.^. ReadableId ==. u E.^. UserReadingReadableId)
             where_ (u E.^. UserReadingUserId ==. val userId)
             return (r, u)

  defaultLayout $(widgetFile "profile")

Fix return value in profile join query
Fix return value in profile join query
