fixing vanity links
This commit is contained in:
parent
4d936a0910
commit
577f8634c8
2 changed files with 18 additions and 1 deletions
|
@ -48,3 +48,19 @@ getAlbumR albumId = do
|
|||
Nothing -> do
|
||||
setMessage "This album does not exist"
|
||||
redirect HomeR
|
||||
|
||||
getBeautyAlbumR :: T.Text -> T.Text -> Handler Html
|
||||
getBeautyAlbumR ownerName albumName = do
|
||||
tempOwner <- runDB $ getBy $ UniqueUser ownerName
|
||||
case tempOwner of
|
||||
Just (Entity ownerId _) -> do
|
||||
tempAlbum <- rundB $ selectFirst [AlbumTitle ==. albumName, albumOwner ==. ownerId] []
|
||||
case tempAlbum of
|
||||
Just (Entity albumId _) ->
|
||||
getAlbumR albumId
|
||||
Nothing -> do
|
||||
setMessage $ "This user has no album named " `T.append` albumName
|
||||
redirect $ UserR ownerName
|
||||
Nothing -> do
|
||||
setMessage "This user does not exist"
|
||||
redirect HomeR
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
/logout LogoutR GET
|
||||
/activate/#T.Text ActivateR GET POST
|
||||
/profile/#UserId ProfileR GET
|
||||
/user/#T.Text UserR GET
|
||||
/#T.Text UserR GET
|
||||
/#T.Text/T.Text BeatyAlbumR GET
|
||||
/upload UploadR GET POST
|
||||
/newalbum NewAlbumR GET POST
|
||||
/album/#AlbumId AlbumR GET
|
||||
|
|
Loading…
Reference in a new issue