mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-11 19:58:28 +01:00
15 lines
405 B
Haskell
15 lines
405 B
Haskell
module Handler.Email where
|
|
|
|
import Import
|
|
import Database.Persist.Sql (deleteWhereCount)
|
|
|
|
deleteEmailR :: EmailId -> Handler ()
|
|
deleteEmailR eid = do
|
|
Entity uid _ <- requireAuth
|
|
cnt <- runDB $ deleteWhereCount [EmailUser ==. uid, EmailId ==. eid]
|
|
setMessage $
|
|
if cnt > 0
|
|
then "Email address deleted"
|
|
else "No matching email address found"
|
|
redirect ProfileR
|