added generic user route
This commit is contained in:
parent
cfad583b75
commit
af988704d6
2 changed files with 12 additions and 1 deletions
|
@ -18,3 +18,13 @@ getProfileR ownerId = do
|
||||||
return False
|
return False
|
||||||
defaultLayout $ do
|
defaultLayout $ do
|
||||||
$(widgetFile "profile")
|
$(widgetFile "profile")
|
||||||
|
|
||||||
|
getUserR :: Text -> Handler Html
|
||||||
|
getUserR ownerName = do
|
||||||
|
tempOwner <- runDB $ selectFirst [UserName ==. ownerName] []
|
||||||
|
case tempOwner of
|
||||||
|
Just (Entity ownerId owner) ->
|
||||||
|
getProfileR ownerId
|
||||||
|
Nothing -> do
|
||||||
|
setMessage "This user does not exist"
|
||||||
|
redirect $ HomeR
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
/login LoginR GET POST
|
/login LoginR GET POST
|
||||||
/logout LogoutR GET
|
/logout LogoutR GET
|
||||||
/activate/#Text ActivateR GET
|
/activate/#Text ActivateR GET
|
||||||
/user/#UserId ProfileR GET
|
/profile/#UserId ProfileR GET
|
||||||
|
/user/#Text UserR GET
|
||||||
/upload UploadR GET POST
|
/upload UploadR GET POST
|
||||||
/newalbum NewAlbumR GET POST
|
/newalbum NewAlbumR GET POST
|
||||||
/album/#AlbumId AlbumR GET
|
/album/#AlbumId AlbumR GET
|
||||||
|
|
Loading…
Reference in a new issue