fixed forgotten things
This commit is contained in:
parent
cf2c3f652f
commit
94582c7f6a
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue