Database #2

Merged
mosbach merged 8 commits from database into main 2024-01-19 02:11:58 +01:00
Showing only changes of commit 64d7e07f35 - Show all commits

View File

@ -67,7 +67,7 @@ instance UserData (Entity User) (Map Text Text) where
data Scope (Entity User) = ID | Profile deriving (Show, Read, Eq)
readScope = read
showScope = show
userScope (Entity uID _) ID = M.singleton "id" . T.pack $ show uID
userScope (Entity _ User{..}) ID = M.singleton "id" userEmail
userScope (Entity _ User{..}) Profile = M.fromList [("name", userName), ("email", userEmail)]
lookupUser email _ = runDB $ do
user <- selectList [UserEmail ==. email] []