fixed forgotten things

This commit is contained in:
nek0 2014-09-07 07:03:06 +02:00
parent cf2c3f652f
commit 94582c7f6a

View file

@ -23,7 +23,7 @@ postNewAlbumR = do
msu <- lookupSession "userId" msu <- lookupSession "userId"
case msu of case msu of
Just tempUserId -> do Just tempUserId -> do
userId <- lift $ pure $ getUserIdFromText tempUserId userId <- return $ getUserIdFromText tempUserId
((result, albumWidget), enctype) <- runFormPost (albumForm userId) ((result, albumWidget), enctype) <- runFormPost (albumForm userId)
case result of case result of
FormSuccess album -> do FormSuccess album -> do
@ -39,6 +39,12 @@ postNewAlbumR = do
-- outro -- outro
setMessage $ "Album successfully created" setMessage $ "Album successfully created"
redirect $ ProfileR userId redirect $ ProfileR userId
_ -> do
setMessage "There was an error creating the album"
redirect $ NewAlbumR
Nothing -> do
setMessage "You must be logged in to create albums"
redirect $ LoginR
albumForm :: UserId -> Form Album albumForm :: UserId -> Form Album
albumForm userId = renderDivs $ Album albumForm userId = renderDivs $ Album